View Javadoc
1   /*
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2026, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v2.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.classic.kryo;
15  
16  import ch.qos.logback.classic.spi.StackTraceElementProxy;
17  import com.esotericsoftware.kryo.kryo5.Kryo;
18  import com.esotericsoftware.kryo.kryo5.Serializer;
19  import com.esotericsoftware.kryo.kryo5.io.Input;
20  import com.esotericsoftware.kryo.kryo5.io.Output;
21  
22  public class StackTraceElementProxySerializer extends Serializer<StackTraceElementProxy>  {
23  
24  
25      @Override
26      public void write(Kryo kryo, Output output, StackTraceElementProxy step) {
27          kryo.writeObject(output, step.getStackTraceElement());
28      }
29  
30      @Override
31      public StackTraceElementProxy read(Kryo kryo, Input input, Class<? extends StackTraceElementProxy> type) {
32         StackTraceElement ste = kryo.readObject(input, StackTraceElement.class);
33         StackTraceElementProxy step = new StackTraceElementProxy(ste);
34          return step;
35      }
36  }