public class SerializerBase extends Serializer<Object>
Modifier and Type | Class and Description |
---|---|
protected static class |
SerializerBase.Deser<A> |
protected static class |
SerializerBase.DeserInt |
protected static class |
SerializerBase.DeserLong |
protected static class |
SerializerBase.DeserSerializer |
protected class |
SerializerBase.DeserSingleton
always returns single object without reading anything
|
protected static class |
SerializerBase.DeserStringLen |
protected static class |
SerializerBase.FastArrayList<K>
Utility class similar to ArrayList, but with fast identity search.
|
protected static interface |
SerializerBase.Header
Header byte, is used at start of each record to indicate data type
WARNING !!! values bellow must be unique !!!!!
|
protected static interface |
SerializerBase.HeaderMapDB |
protected static interface |
SerializerBase.Ser<A> |
protected class |
SerializerBase.SerHeader
writes single byte header
|
protected static class |
SerializerBase.SerHeaderSerializer |
Serializer.Array<T>, Serializer.CompressionDeflateWrapper<E>, Serializer.CompressionWrapper<E>, Serializer.EightByteSerializer<E>, Serializer.FourByteSerializer<E>, Serializer.IntegerSerializer, Serializer.LongSerializer
BASIC, BIG_DECIMAL, BIG_INTEGER, BOOLEAN, BOOLEAN_ARRAY, BYTE, BYTE_ARRAY, BYTE_ARRAY_NOSIZE, CHAR, CHAR_ARRAY, CLASS, DATE, DOUBLE, DOUBLE_ARRAY, FLOAT, FLOAT_ARRAY, ILLEGAL_ACCESS, INT_ARRAY, INTEGER, INTEGER_PACKED, INTEGER_PACKED_ZIGZAG, JAVA, LONG, LONG_ARRAY, LONG_PACKED, LONG_PACKED_ZIGZAG, RECID, RECID_ARRAY, SHORT, SHORT_ARRAY, STRING, STRING_ASCII, STRING_INTERN, STRING_NOSIZE, UUID
Constructor and Description |
---|
SerializerBase() |
Modifier and Type | Method and Description |
---|---|
void |
assertSerializable(Object o) |
protected static byte[] |
booleanToByteArray(boolean[] bool)
Builds a byte array from the array of booleans, compressing up to 8 booleans per byte.
|
Object |
deserialize(DataInput in,
int capacity)
Deserialize the content of an object from a DataInput.
|
Object |
deserialize(DataInput in,
SerializerBase.FastArrayList<Object> objectStack) |
protected Class |
deserializeClass(DataInput is) |
protected Object |
deserializeMapDB(DataInput is,
SerializerBase.FastArrayList<Object> objectStack) |
protected Object |
deserializeUnknownHeader(DataInput is,
int head,
SerializerBase.FastArrayList<Object> objectStack)
override this method to extend SerializerBase functionality
|
protected Engine |
getEngine() |
protected void |
initHeaderDeser() |
protected void |
initMapdb() |
protected void |
initSer() |
boolean |
isSerializable(Object o)
return true if mapdb knows howto serialize given object
|
boolean |
isTrusted() |
protected static boolean[] |
readBooleanArray(int numBools,
DataInput is)
Unpacks an integer from the DataInput indicating the number of booleans that are compressed.
|
void |
serialize(DataOutput out,
Object obj)
Serialize the content of an object into a ObjectOutput
|
void |
serialize(DataOutput out,
Object obj,
SerializerBase.FastArrayList<Object> objectStack) |
protected void |
serializeClass(DataOutput out,
Class clazz) |
void |
serializeObjectArray(DataOutput out,
Object[] b,
SerializerBase.FastArrayList objectStack) |
protected void |
serializeUnknownObject(DataOutput out,
Object obj,
SerializerBase.FastArrayList<Object> objectStack)
override this method to extend SerializerBase functionality
|
equals, fixedSize, getBTreeKeySerializer, hashCode, valueArrayCopyOfRange, valueArrayDeleteValue, valueArrayDeserialize, valueArrayEmpty, valueArrayFromArray, valueArrayGet, valueArrayPut, valueArraySerialize, valueArraySize, valueArrayUpdateVal
protected final Map<Class,SerializerBase.Ser> ser
protected final SerializerBase.Deser[] headerDeser
protected static final SerializerBase.Ser SER_STRING
protected static final SerializerBase.Ser SER_LONG_ARRAY
protected static final SerializerBase.Ser SER_INT_ARRAY
protected static final SerializerBase.Ser SER_DOUBLE
protected static final SerializerBase.Ser SER_FLOAT
protected static final SerializerBase.Ser SER_SHORT
protected static final SerializerBase.Ser SER_CHAR
protected static final SerializerBase.Ser SER_BYTE
protected static final SerializerBase.Ser SER_BOOLEAN
protected static final SerializerBase.Ser SER_LONG
protected static final SerializerBase.Ser SER_INT
protected static final SerializerBase.Ser SER_MA_LONG
protected static final SerializerBase.Ser SER_MA_INT
protected static final SerializerBase.Ser SER_MA_BOOL
protected static final SerializerBase.Ser SER_MA_STRING
protected final SerializerBase.Ser SER_MA_VAR
protected static final SerializerBase.Ser<byte[]> SER_BYTE_ARRAY
protected final Store.LongObjectMap<Object> mapdb_reverse
protected void initSer()
public void serializeObjectArray(DataOutput out, Object[] b, SerializerBase.FastArrayList objectStack) throws IOException
IOException
protected void initHeaderDeser()
public void serialize(DataOutput out, Object obj) throws IOException
Serializer
serialize
in class Serializer<Object>
out
- ObjectOutput to save object intoobj
- Object to serializeIOException
public void serialize(DataOutput out, Object obj, SerializerBase.FastArrayList<Object> objectStack) throws IOException
IOException
protected void serializeClass(DataOutput out, Class clazz) throws IOException
IOException
public Object deserialize(DataInput in, int capacity) throws IOException
Serializer
deserialize
in class Serializer<Object>
in
- to read serialized data fromcapacity
- how many bytes are available in DataInput for reading, may be -1 (in streams) or 0 (null).IOException
public Object deserialize(DataInput in, SerializerBase.FastArrayList<Object> objectStack) throws IOException
IOException
protected void initMapdb()
public void assertSerializable(Object o)
protected Object deserializeMapDB(DataInput is, SerializerBase.FastArrayList<Object> objectStack) throws IOException
IOException
protected Engine getEngine()
protected Class deserializeClass(DataInput is) throws IOException
IOException
protected void serializeUnknownObject(DataOutput out, Object obj, SerializerBase.FastArrayList<Object> objectStack) throws IOException
IOException
protected Object deserializeUnknownHeader(DataInput is, int head, SerializerBase.FastArrayList<Object> objectStack) throws IOException
IOException
protected static byte[] booleanToByteArray(boolean[] bool)
bool
- The booleans to be compressed.protected static boolean[] readBooleanArray(int numBools, DataInput is) throws IOException
numBools
elements. This is
necessary in situations where the number of booleans is not a multiple of 8.
Author of this method is Chris Alexander.IOException
- If an error occurred while reading.public boolean isTrusted()
isTrusted
in class Serializer<Object>
public boolean isSerializable(Object o)
Copyright © 2015. All Rights Reserved.