public interface Serializer
Serializer implementations should implement the ClassLoaderAware interface if they need access to a ClassLoader. However, to support hot-deploying containers, it is important that a Serializer not hold any strong references to that ClassLoader, or to any Class objects obtained from that ClassLoader.
Note:<b/> it is extremely important that objects that are equivalent according to their "equals()" implementation produce equivalent serialized streams. Violating this relationship will result in non-deterministic behavior for many Coherence services.
ReadBuffer
, WriteBuffer
Modifier and Type | Method and Description |
---|---|
Object |
deserialize(ReadBuffer.BufferInput in)
Deserialize an object from a ReadBuffer by reading its state using the specified BufferInput object.
|
void |
serialize(WriteBuffer.BufferOutput out, Object o)
Serialize an object to a WriteBuffer by writing its state using the specified BufferOutput object.
|
void serialize(WriteBuffer.BufferOutput out, Object o) throws IOException
Note: Starting with Coherence 12.2.1 classes that need to designate an alternative object to be used by the Serializer when writing the object to the buffer should implement the SerializationSupport.writeReplace()
method.
out
- the BufferOutput with which to write the object's stateo
- the object to serializeIOException
- if an I/O error occursObject deserialize(ReadBuffer.BufferInput in) throws IOException
Note: Starting with Coherence 12.2.1 classes that need to designate an alternative object to be returned by the Serializer after an object is deserialized from the buffer should implement the SerializationSupport.readResolve()
method.
in
- the BufferInput with which to read the object's stateIOException
- if an I/O error occurs