public class ElsaSerializerBase extends Object implements ElsaSerializer
| Modifier and Type | Class and Description |
|---|---|
static class |
ElsaSerializerBase.Deser<A> |
protected static class |
ElsaSerializerBase.DeserInt |
protected static class |
ElsaSerializerBase.DeserLong |
protected class |
ElsaSerializerBase.DeserSingleton
always returns single object without reading anything
|
protected static class |
ElsaSerializerBase.DeserStringLen |
protected static interface |
ElsaSerializerBase.Header
Header byte, is used at start of each record to indicate data type
WARNING !!! values bellow must be unique !!!!!
|
static class |
ElsaSerializerBase.Ser<A> |
protected static class |
ElsaSerializerBase.UserSer |
| Constructor and Description |
|---|
ElsaSerializerBase() |
ElsaSerializerBase(int objectStackType,
Object[] singletons,
Map<Class,ElsaSerializerBase.Ser> userSer,
Map<Class,Integer> userSerHeaders,
Map<Integer,ElsaSerializerBase.Deser> userDeser) |
| Modifier and Type | Method and Description |
|---|---|
<E> E |
clone(E value) |
<E> E |
deserialize(DataInput in) |
Object |
deserialize(DataInput in,
ElsaStack objectStack) |
protected Object |
deserializeSingleton(DataInput is,
ElsaStack objectStack) |
protected Object |
deserializeUnknownHeader(DataInput is,
int head,
ElsaStack objectStack)
override this method to extend ElsaSerializerBase functionality
|
protected void |
initHeaderDeser() |
protected void |
initSer() |
boolean |
isSerializable(Object o)
return true if mapdb knows howto serialize given object
|
protected Class<?> |
loadClass(String name) |
protected Class |
loadClass2(DataInput is) |
protected Class |
loadClass2(String name) |
protected static Class |
loadClass3(String name,
ClassLoader classLoader) |
protected ElsaStack |
newElsaStack() |
protected static boolean[] |
readBooleanArray(int numBools,
DataInput is)
Unpacks boolean[], each value in array is represented by single bite
|
void |
serialize(DataOutput out,
Object obj) |
void |
serialize(DataOutput out,
Object obj,
ElsaStack objectStack) |
protected void |
serializeClass(DataOutput out,
Class clazz) |
void |
serializeObjectArray(DataOutput out,
Object[] b,
ElsaStack objectStack) |
protected void |
serializeUnknownObject(DataOutput out,
Object obj,
ElsaStack objectStack)
override this method to extend ElsaSerializerBase functionality
|
protected static void |
writeBooleanArray(DataOutput out,
boolean[] bool)
Writes boolean[] into output, each value in array is represented by single byte
|
protected final int objectStackType
protected final Object[] singletons
protected final IdentityHashMap<Object,Integer> singletonsReverse
protected final Map<Class,ElsaSerializerBase.Ser> ser
protected final ElsaSerializerBase.Deser[] headerDeser
protected final ElsaSerializerBase.Deser[] userDeser
protected final ClassLoader classLoader
protected static final ElsaSerializerBase.Ser SER_STRING
protected static final ElsaSerializerBase.Ser SER_LONG_ARRAY
protected static final ElsaSerializerBase.Ser SER_INT_ARRAY
protected static final ElsaSerializerBase.Ser SER_DOUBLE
protected static final ElsaSerializerBase.Ser SER_FLOAT
protected static final ElsaSerializerBase.Ser SER_SHORT
protected static final ElsaSerializerBase.Ser SER_CHAR
protected static final ElsaSerializerBase.Ser SER_BYTE
protected static final ElsaSerializerBase.Ser SER_BOOLEAN
protected static final ElsaSerializerBase.Ser SER_LONG
protected static final ElsaSerializerBase.Ser SER_INT
protected static final ElsaSerializerBase.Ser<byte[]> SER_BYTE_ARRAY
protected static final ElsaSerializerBase.Deser<byte[]> DESER_BYTE_ARRAY
public ElsaSerializerBase()
public ElsaSerializerBase(int objectStackType,
Object[] singletons,
Map<Class,ElsaSerializerBase.Ser> userSer,
Map<Class,Integer> userSerHeaders,
Map<Integer,ElsaSerializerBase.Deser> userDeser)
protected Class<?> loadClass(String name) throws ClassNotFoundException
ClassNotFoundExceptionprotected Class loadClass2(DataInput is) throws IOException
IOExceptionprotected static Class loadClass3(String name, ClassLoader classLoader)
protected void initSer()
public void serializeObjectArray(DataOutput out, Object[] b, ElsaStack objectStack) throws IOException
IOExceptionprotected void initHeaderDeser()
public void serialize(DataOutput out, Object obj) throws IOException
serialize in interface ElsaSerializerIOExceptionprotected ElsaStack newElsaStack()
public <E> E clone(E value)
throws IOException
clone in interface ElsaSerializerIOExceptionpublic void serialize(DataOutput out, Object obj, ElsaStack objectStack) throws IOException
IOExceptionprotected void serializeClass(DataOutput out, Class clazz) throws IOException
IOExceptionpublic <E> E deserialize(DataInput in) throws IOException
deserialize in interface ElsaSerializerIOExceptionpublic Object deserialize(DataInput in, ElsaStack objectStack) throws IOException
IOExceptionprotected Object deserializeSingleton(DataInput is, ElsaStack objectStack) throws IOException
IOExceptionprotected void serializeUnknownObject(DataOutput out, Object obj, ElsaStack objectStack) throws IOException
IOExceptionprotected Object deserializeUnknownHeader(DataInput is, int head, ElsaStack objectStack) throws IOException
IOExceptionprotected static void writeBooleanArray(DataOutput out, boolean[] bool) throws IOException
bool - The booleans to be writen.IOExceptionprotected static boolean[] readBooleanArray(int numBools,
DataInput is)
throws IOException
IOException - If an error occurred while reading.public boolean isSerializable(Object o)
Copyright © 2016. All Rights Reserved.