Class ElsaUtil

java.lang.Object
org.mapdb.elsa.ElsaUtil

public final class ElsaUtil extends Object
Utilities for Elsa Serialization
  • Constructor Details

    • ElsaUtil

      private ElsaUtil()
  • Method Details

    • unpackInt

      public static int unpackInt(DataInput is) throws IOException
      Unpack int value from the input stream.
      Parameters:
      is - The input stream.
      Returns:
      The long value.
      Throws:
      IOException - in case of IO error
    • unpackLong

      public static long unpackLong(DataInput in) throws IOException
      Unpack long value from the input stream.
      Parameters:
      in - The input stream.
      Returns:
      The long value.
      Throws:
      IOException - in case of IO error
    • unpackInt

      public static int unpackInt(InputStream in) throws IOException
      Unpack int value from the input stream.
      Parameters:
      in - The input stream.
      Returns:
      The long value.
      Throws:
      IOException - in case of IO error
    • unpackLong

      public static long unpackLong(InputStream in) throws IOException
      Unpack long value from the input stream.
      Parameters:
      in - The input stream.
      Returns:
      The long value.
      Throws:
      IOException - in case of IO error
    • packLong

      public static void packLong(DataOutput out, long value) throws IOException
      Pack long into output. It will occupy 1-10 bytes depending on value (lower values occupy smaller space)
      Parameters:
      out - DataOutput to put value into
      value - to be serialized, must be non-negative
      Throws:
      IOException - in case of IO error
    • packLong

      public static void packLong(OutputStream out, long value) throws IOException
      Pack long into output. It will occupy 1-10 bytes depending on value (lower values occupy smaller space)
      Parameters:
      out - OutputStream to put value into
      value - to be serialized, must be non-negative
      Throws:
      IOException - in case of IO error
    • packInt

      public static void packInt(DataOutput out, int value) throws IOException
      Pack int into an output stream. It will occupy 1-5 bytes depending on value (lower values occupy smaller space)
      Parameters:
      out - DataOutput to put value into
      value - to be serialized, must be non-negative
      Throws:
      IOException - in case of IO error
    • packIntBigger

      public static void packIntBigger(DataOutput out, int value) throws IOException
      Pack int into an output stream. It will occupy 1-5 bytes depending on value (lower values occupy smaller space) This method is same as packInt(DataOutput, int), but is optimized for values larger than 127. Usually it is recids.
      Parameters:
      out - String to put value into
      value - to be serialized, must be non-negative
      Throws:
      IOException - in case of IO error
    • findUnknownClassesInCollection

      public static Class[] findUnknownClassesInCollection(Iterable e)
      Serializes content of iterable to find unknown classes. That can be passed to ElsaMaker.registerClasses(Class[]) }
      Parameters:
      e - iterable over objects, whose object graph will be checked
      Returns:
      array of unknown classes found in object graph
    • findUnknownClasses

      public static Class[] findUnknownClasses(Object e)