Class SafeObjectCodec
java.lang.Object
ch.qos.logback.classic.kryo.SafeObjectCodec
Compact wire encoding for objects reduced by
SafeObjectTransformer.
Applies SafeObjectTransformer.asAllowedNonNullObject(Object), then writes a
1-byte type tag and a type-specific payload (never writeClassAndObject).
tag (1 byte) + payload
0 NULL — no payload (null or SafeObjectTransformer.NULL_PROXY)
1 STRING — SingleItemCompressingStringSerializer
2 INTEGER — writeVarInt (zig-zag)
3 LONG — writeVarLong (zig-zag)
4 SHORT — writeShort
5 FLOAT — writeFloat
6 DOUBLE — writeDouble
Used for KVP values and message argument arrays.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byte -
Method Summary
Modifier and TypeMethodDescriptionstatic Objectread(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Input input, com.esotericsoftware.kryo.kryo5.Serializer<String> stringSerializer) Inverse ofwrite(Kryo, Output, Serializer, Object).static voidwrite(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Output output, com.esotericsoftware.kryo.kryo5.Serializer<String> stringSerializer, Object rawValue) EncodesrawValueafterSafeObjectTransformer.asAllowedNonNullObject(Object).
-
Field Details
-
TAG_NULL
- See Also:
-
TAG_STRING
- See Also:
-
TAG_INTEGER
- See Also:
-
TAG_LONG
- See Also:
-
TAG_SHORT
- See Also:
-
TAG_FLOAT
- See Also:
-
TAG_DOUBLE
- See Also:
-
-
Method Details
-
write
public static void write(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Output output, com.esotericsoftware.kryo.kryo5.Serializer<String> stringSerializer, Object rawValue) EncodesrawValueafterSafeObjectTransformer.asAllowedNonNullObject(Object).SafeObjectTransformer.NULL_PROXYis written asTAG_NULLand restored asnullon read. -
read
public static Object read(com.esotericsoftware.kryo.kryo5.Kryo kryo, com.esotericsoftware.kryo.kryo5.io.Input input, com.esotericsoftware.kryo.kryo5.Serializer<String> stringSerializer) Inverse ofwrite(Kryo, Output, Serializer, Object).
-