Package org.mapdb.elsa
Class ElsaUtil
java.lang.Object
org.mapdb.elsa.ElsaUtil
Utilities for Elsa Serialization
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Class[]static Class[]Serializes content of iterable to find unknown classes.static voidpackInt(DataOutput out, int value) Pack int into an output stream.static voidpackIntBigger(DataOutput out, int value) Pack int into an output stream.static voidpackLong(DataOutput out, long value) Pack long into output.static voidpackLong(OutputStream out, long value) Pack long into output.static intUnpack int value from the input stream.static intunpackInt(InputStream in) Unpack int value from the input stream.static longunpackLong(DataInput in) Unpack long value from the input stream.static longUnpack long value from the input stream.
-
Constructor Details
-
ElsaUtil
private ElsaUtil()
-
-
Method Details
-
unpackInt
Unpack int value from the input stream.- Parameters:
is- The input stream.- Returns:
- The long value.
- Throws:
IOException- in case of IO error
-
unpackLong
Unpack long value from the input stream.- Parameters:
in- The input stream.- Returns:
- The long value.
- Throws:
IOException- in case of IO error
-
unpackInt
Unpack int value from the input stream.- Parameters:
in- The input stream.- Returns:
- The long value.
- Throws:
IOException- in case of IO error
-
unpackLong
Unpack long value from the input stream.- Parameters:
in- The input stream.- Returns:
- The long value.
- Throws:
IOException- in case of IO error
-
packLong
Pack 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:
IOException- in case of IO error
-
packLong
Pack 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:
IOException- in case of IO error
-
packInt
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 intovalue- to be serialized, must be non-negative- Throws:
IOException- in case of IO error
-
packIntBigger
Pack 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:
IOException- in case of IO error
-
findUnknownClassesInCollection
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
-