Class Serializers
- java.lang.Object
-
- com.complexible.common.primitives.Serializers
-
public final class Serializers extends java.lang.Object
Provides support for serializing/deserializing object or primitive values to/from byte arrays. The generic interface for object serialization is slightly different than primitive serializers since typically the size of a serialized object changes based on contents. Primitive values on the other hand have fixed serialization size.- Author:
- Evren Sirin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Serializers.IntSerializer
Serializer for primitive integer values.static class
Serializers.LittleEndianLongSerializer
static class
Serializers.LongSerializer
Serializes the given long to 8 bytes.static interface
Serializers.ObjectSerializer<T>
Generic serializer interface for objects.static class
Serializers.ShortSerializer
Serializes the given short to 2 bytes.static class
Serializers.UnsignedLongSerializer
Serialize longs in an "Unsigned" form.static class
Serializers.VarLongSerializer
Serializes the given long to as many bytes as required.
-
Field Summary
Fields Modifier and Type Field Description static Serializers.ObjectSerializer<java.util.BitSet>
BIT_SET
static Serializers.IntSerializer
INT
static Serializers.ObjectSerializer<com.carrotsearch.hppc.IntArrayList>
INT_ARRAY
static Serializers.LittleEndianLongSerializer
LITTLE_LONG
static Serializers.LongSerializer
LONG
static Serializers.ShortSerializer
SHORT
static Serializers.ObjectSerializer<java.lang.String>
STRING
Serializer for strings using UTF-8 encoding.static Serializers.UnsignedLongSerializer
UNSIGNED_LONG
static Serializers.VarLongSerializer
VAR_LONG
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String... args)
-
-
-
Field Detail
-
INT
public static final Serializers.IntSerializer INT
-
LONG
public static final Serializers.LongSerializer LONG
-
LITTLE_LONG
public static final Serializers.LittleEndianLongSerializer LITTLE_LONG
-
UNSIGNED_LONG
public static final Serializers.UnsignedLongSerializer UNSIGNED_LONG
-
VAR_LONG
public static final Serializers.VarLongSerializer VAR_LONG
-
SHORT
public static final Serializers.ShortSerializer SHORT
-
STRING
public static final Serializers.ObjectSerializer<java.lang.String> STRING
Serializer for strings using UTF-8 encoding. Serialization does not include the length of the string so when deserializing the correct string length should be provided out-of-band.
-
INT_ARRAY
public static final Serializers.ObjectSerializer<com.carrotsearch.hppc.IntArrayList> INT_ARRAY
-
BIT_SET
public static final Serializers.ObjectSerializer<java.util.BitSet> BIT_SET
-
-