001/*
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2026, QOS.ch. All rights reserved.
004 *
005 * This program and the accompanying materials are dual-licensed under
006 * either the terms of the Eclipse Public License v2.0 as published by
007 * the Eclipse Foundation
008 *
009 *   or (per the licensee's choosing)
010 *
011 * under the terms of the GNU Lesser General Public License version 2.1
012 * as published by the Free Software Foundation.
013 */
014package ch.qos.logback.classic.kryo;
015
016import ch.qos.logback.classic.spi.StackTraceElementProxy;
017import com.esotericsoftware.kryo.kryo5.Kryo;
018import com.esotericsoftware.kryo.kryo5.Serializer;
019import com.esotericsoftware.kryo.kryo5.io.Input;
020import com.esotericsoftware.kryo.kryo5.io.Output;
021
022public class StackTraceElementProxySerializer extends Serializer<StackTraceElementProxy>  {
023
024
025    @Override
026    public void write(Kryo kryo, Output output, StackTraceElementProxy step) {
027        kryo.writeObject(output, step.getStackTraceElement());
028    }
029
030    @Override
031    public StackTraceElementProxy read(Kryo kryo, Input input, Class<? extends StackTraceElementProxy> type) {
032       StackTraceElement ste = kryo.readObject(input, StackTraceElement.class);
033       StackTraceElementProxy step = new StackTraceElementProxy(ste);
034        return step;
035    }
036}