Package org.mapdb.elsa
Class ElsaUtil
- java.lang.Object
-
- org.mapdb.elsa.ElsaUtil
-
public final class ElsaUtil extends java.lang.ObjectUtilities for Elsa Serialization
-
-
Constructor Summary
Constructors Modifier Constructor Description privateElsaUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class[]findUnknownClasses(java.lang.Object e)static java.lang.Class[]findUnknownClassesInCollection(java.lang.Iterable e)Serializes content of iterable to find unknown classes.static voidpackInt(java.io.DataOutput out, int value)Pack int into an output stream.static voidpackIntBigger(java.io.DataOutput out, int value)Pack int into an output stream.static voidpackLong(java.io.DataOutput out, long value)Pack long into output.static voidpackLong(java.io.OutputStream out, long value)Pack long into output.static intunpackInt(java.io.DataInput is)Unpack int value from the input stream.static intunpackInt(java.io.InputStream in)Unpack int value from the input stream.static longunpackLong(java.io.DataInput in)Unpack long value from the input stream.static longunpackLong(java.io.InputStream in)Unpack long value from the input stream.
-
-
-
Method Detail
-
unpackInt
public static int unpackInt(java.io.DataInput is) throws java.io.IOExceptionUnpack int value from the input stream.- Parameters:
is- The input stream.- Returns:
- The long value.
- Throws:
java.io.IOException- in case of IO error
-
unpackLong
public static long unpackLong(java.io.DataInput in) throws java.io.IOExceptionUnpack long value from the input stream.- Parameters:
in- The input stream.- Returns:
- The long value.
- Throws:
java.io.IOException- in case of IO error
-
unpackInt
public static int unpackInt(java.io.InputStream in) throws java.io.IOExceptionUnpack int value from the input stream.- Parameters:
in- The input stream.- Returns:
- The long value.
- Throws:
java.io.IOException- in case of IO error
-
unpackLong
public static long unpackLong(java.io.InputStream in) throws java.io.IOExceptionUnpack long value from the input stream.- Parameters:
in- The input stream.- Returns:
- The long value.
- Throws:
java.io.IOException- in case of IO error
-
packLong
public static void packLong(java.io.DataOutput out, long value) throws java.io.IOExceptionPack long into output. It will occupy 1-10 bytes depending on value (lower values occupy smaller space)- Parameters:
out- DataOutput to put value intovalue- to be serialized, must be non-negative- Throws:
java.io.IOException- in case of IO error
-
packLong
public static void packLong(java.io.OutputStream out, long value) throws java.io.IOExceptionPack long into output. It will occupy 1-10 bytes depending on value (lower values occupy smaller space)- Parameters:
out- OutputStream to put value intovalue- to be serialized, must be non-negative- Throws:
java.io.IOException- in case of IO error
-
packInt
public static void packInt(java.io.DataOutput out, int value) throws java.io.IOExceptionPack 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 intovalue- to be serialized, must be non-negative- Throws:
java.io.IOException- in case of IO error
-
packIntBigger
public static void packIntBigger(java.io.DataOutput out, int value) throws java.io.IOExceptionPack int into an output stream. It will occupy 1-5 bytes depending on value (lower values occupy smaller space) This method is same aspackInt(DataOutput, int), but is optimized for values larger than 127. Usually it is recids.- Parameters:
out- String to put value intovalue- to be serialized, must be non-negative- Throws:
java.io.IOException- in case of IO error
-
findUnknownClassesInCollection
public static java.lang.Class[] findUnknownClassesInCollection(java.lang.Iterable e)
Serializes content of iterable to find unknown classes. That can be passed toElsaMaker.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 java.lang.Class[] findUnknownClasses(java.lang.Object e)
-
-