Class SerializerBase<V>

java.lang.Object
com.esotericsoftware.kryo.kryo5.Serializer<V>
ch.qos.logback.core.kryo.SerializerBase<V>
Direct Known Subclasses:
BasicStringSerializer, ClassNameSerializer, KeyValuePairSerializer, LoggerContextVOSerializer, MDCPropertyMapSerializer, MultiEventCompressedStringSerializer, SingleItemCompressingStringSerializer, StackTraceElementProxySerializerV5, StackTraceElementSerializer

public abstract class SerializerBase<V> extends com.esotericsoftware.kryo.kryo5.Serializer<V>
Base Kryo serializer with optional value↔id caching.

When a bimap is configured, each value is introduced with a 2-byte header packing a 13-bit data word (NEW/CACHED flag + 12-bit id) and a 3-bit CRC over those data bits. Ids must be in 1..MAX_SERIALIZER_ID, or KryoCoreConstants.UNREGISTERED_ID for frequency-gated non-registrations. Cached hits write only that header; new values also write the payload via writeNewEntry(Kryo, Output, V).

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SerializerBase(int capacity)
     
    SerializerBase(SerializerBase.BiMapType biMapType, int capacity)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    read(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Input input, Class<? extends V> type)
     
    protected abstract V
    readNewEntry(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Input input)
     
    void
    write(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Output output, V value)
     
    protected abstract void
    writeNewEntry(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Output output, V value)
    Method called to write new entries.

    Methods inherited from class com.esotericsoftware.kryo.kryo5.Serializer

    copy, getAcceptsNull, isImmutable, setAcceptsNull, setImmutable

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • write

      public void write(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Output output, V value)
      Specified by:
      write in class com.esotericsoftware.kryo.kryo5.Serializer<V>
    • writeNewEntry

      protected abstract void writeNewEntry(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Output output, V value)
      Method called to write new entries.
      Parameters:
      kryo -
      output -
      value -
    • read

      public V read(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Input input, Class<? extends V> type)
      Specified by:
      read in class com.esotericsoftware.kryo.kryo5.Serializer<V>
    • readNewEntry

      protected abstract V readNewEntry(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Input input)