Package com.complexible.common.primitives

# Class Serializers

java.lang.Object
com.complexible.common.primitives.Serializers

public final class Serializers extends 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 final class`
  `Serializers.IntSerializer`
  Serializer for primitive integer values.
  `static final class`
  `Serializers.LittleEndianLongSerializer`
  `static final class`
  `Serializers.LongSerializer`
  Serializes the given long to 8 bytes.
  `static interface`
  `Serializers.ObjectSerializer<T>`
  Generic serializer interface for objects.
  `static final class`
  `Serializers.ShortSerializer`
  Serializes the given short to 2 bytes.
  `static final class`
  `Serializers.UnsignedLongSerializer`
  Serialize longs in an "Unsigned" form.
  `static final class`
  `Serializers.VarLongSerializer`
  Serializes the given long to as many bytes as required.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Serializers.ObjectSerializer<BitSet>`
  `BIT_SET`
  `static final Serializers.IntSerializer`
  `INT`
  `static final Serializers.ObjectSerializer<com.carrotsearch.hppc.IntArrayList>`
  `INT_ARRAY`
  `static final Serializers.LittleEndianLongSerializer`
  `LITTLE_LONG`
  `static final Serializers.LongSerializer`
  `LONG`
  `static final Serializers.ShortSerializer`
  `SHORT`
  `static final Serializers.ObjectSerializer<String>`
  `STRING`
  Serializer for strings using UTF-8 encoding.
  `static final Serializers.UnsignedLongSerializer`
  `UNSIGNED_LONG`
  `static final Serializers.VarLongSerializer`
  `VAR_LONG`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `main(String... args)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### 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<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<BitSet> BIT_SET

- ## Method Details

  - ### main

    public static void main(String... args) throws Exception
    Throws:
      `Exception`