|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.serialization.Serializer
org.simantics.databoard.serialization.Serializer.RecursiveSerializer
org.simantics.databoard.serialization.impl.ReferableRecordSerializer
public class ReferableRecordSerializer
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.simantics.databoard.serialization.Serializer |
---|
Serializer.CompositeSerializer, Serializer.NonRecursiveSerializer, Serializer.RecursiveSerializer |
Field Summary | |
---|---|
Serializer[] |
componentSerializers
|
Constructor Summary | |
---|---|
ReferableRecordSerializer(RecordBinding binding,
Serializer[] componentSerializers)
|
Method Summary | |
---|---|
java.lang.Object |
deserialize(java.io.DataInput in,
java.util.List<java.lang.Object> identities)
Deserialize an object from a readable. |
void |
deserialize(java.io.DataInput in,
java.util.List<java.lang.Object> identities,
java.lang.Object obj)
Deserialize into an valid object. |
void |
finalizeConstruction()
Finalize the construction of the serializer. |
java.lang.Integer |
getConstantSize()
Get constant size of the data type in its binary serialized format |
int |
getMinSize()
|
int |
getSize(java.lang.Object obj,
gnu.trove.TObjectIntHashMap<java.lang.Object> identities)
Get the number of bytes required to serialize an object |
void |
serialize(java.io.DataOutput out,
gnu.trove.TObjectIntHashMap<java.lang.Object> identities,
java.lang.Object obj)
Serialize obj to out. |
void |
skip(java.io.DataInput in,
java.util.List<java.lang.Object> identities)
Skip over an object in a stream. |
Methods inherited from class org.simantics.databoard.serialization.Serializer.RecursiveSerializer |
---|
deserialize, deserialize, getSize, serialize, skip |
Methods inherited from class org.simantics.databoard.serialization.Serializer |
---|
deserialize, deserialize, deserialize, deserialize, deserialize, deserialize, getInputStream, serialize, serialize, serialize, skip |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Serializer[] componentSerializers
Constructor Detail |
---|
public ReferableRecordSerializer(RecordBinding binding, Serializer[] componentSerializers)
Method Detail |
---|
public void finalizeConstruction()
Serializer.RecursiveSerializer
finalizeConstruction
in class Serializer.RecursiveSerializer
public java.lang.Object deserialize(java.io.DataInput in, java.util.List<java.lang.Object> identities) throws java.io.IOException
Serializer
null
value can be provided.Note, if in argument is instanceof BinaryReadable or RandomAccessBinary, the serializer performs extra protection against malformed data when deserializing arrays and maps. This prevents the serializer from instanting potentially out-of-memory-invoking huge arrays. For example, if data data says array size is 0xffffffff (-1), 4GB is allocated -> out of memory exception -> unhandled runtime error. BinaryReadable has length limit which allowes serializer to estimate whether future data is readable.
deserialize
in class Serializer
in
- DataInput, BinaryReadable or RandomAccessBinaryidentities
- empty identities array or null
if there is no recursion
java.io.IOException
public void deserialize(java.io.DataInput in, java.util.List<java.lang.Object> identities, java.lang.Object obj) throws java.io.IOException
Serializer
deserialize
in class Serializer
obj
- valid object
java.io.IOException
public void skip(java.io.DataInput in, java.util.List<java.lang.Object> identities) throws java.io.IOException, SerializationException
Serializer
skip
in class Serializer
java.io.IOException
SerializationException
public void serialize(java.io.DataOutput out, gnu.trove.TObjectIntHashMap<java.lang.Object> identities, java.lang.Object obj) throws java.io.IOException
Serializer
null
value can be provided.
serialize
in class Serializer
identities
- Thread local empty map or null
if there is no recursion
java.io.IOException
public java.lang.Integer getConstantSize()
Serializer
getConstantSize
in class Serializer
public int getSize(java.lang.Object obj, gnu.trove.TObjectIntHashMap<java.lang.Object> identities) throws java.io.IOException
Serializer
getSize
in class Serializer
identities
- thread local empty hash map
java.io.IOException
public int getMinSize()
getMinSize
in class Serializer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |