|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bubble.serializer.SerializationContext
The SerializationContext allows Objects and object graphs to be written to a ByteBuffer in serialized form.
The function of the context is to keep track of objects and class data that have already been serialized, replacing previously seen objects with simple references. This allows, for instance, the serialization of objects graphs that contains cycles.
Only objects that implement java.io.Serializable
can be serialized
through a SerializationContext. Currently, custom serialization (through
java.io.Externalizable
or writeObject
method)
as well as other advanced serialization features are not supported.
Objects written to a ByteBuffer by a SerializationContext can be retrieved with a DeserializationContext. The data written to the ByteBuffer is not self-contained, because it may refer to objects or classes that have been previously written. Because of that, data written with a single SerializationContext should be read by a single DeserializationContext.
ByteBuffer
,
Serializable
,
DeserializationContext
Constructor Summary | |
SerializationContext()
Constructs a new SerializationContext. |
Method Summary | |
void |
serialize(java.lang.Object obj,
java.nio.ByteBuffer buffer)
Serializes an object to a ByteBuffer. |
void |
update(java.lang.Object obj,
java.nio.ByteBuffer buffer)
Serializes a new state for an object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SerializationContext()
Method Detail |
public void serialize(java.lang.Object obj, java.nio.ByteBuffer buffer)
The object must implement java.io.Serializable
.
obj
- The object being serialized.buffer
- The buffer to which the object will be serialized.public void update(java.lang.Object obj, java.nio.ByteBuffer buffer)
The object must implement java.io.Serializable
.
obj
- The object being updated.buffer
- The buffer to which the object state will be serialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |