public final class DefaultSerializer extends Object implements Serializer, ClassLoaderAware
Constructor and Description |
---|
DefaultSerializer()
Default constructor.
|
DefaultSerializer(ClassLoader loader)
Construct a DefaultSerializer that will use the passed ClassLoader.
|
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.
|
ClassLoader |
getContextClassLoader()
Retrieve the context ClassLoader for this object.
|
void |
serialize(WriteBuffer.BufferOutput out,
Object o)
Serialize an object to a WriteBuffer by writing its state using the
specified BufferOutput object.
|
void |
setContextClassLoader(ClassLoader loader)
Specify the context ClassLoader for this object.
|
String |
toString()
Return a description of this DefaultSerializer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
deserialize, getName
public DefaultSerializer()
public DefaultSerializer(ClassLoader loader)
loader
- the ClassLoader to use for deserializationpublic void serialize(WriteBuffer.BufferOutput out, Object o) throws IOException
Serializer
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.
serialize
in interface Serializer
out
- the BufferOutput with which to write the object's stateo
- the object to serializeIOException
- if an I/O error occurspublic Object deserialize(ReadBuffer.BufferInput in) throws IOException
Serializer
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.
deserialize
in interface Serializer
in
- the BufferInput with which to read the object's stateIOException
- if an I/O error occurspublic ClassLoader getContextClassLoader()
ClassLoaderAware
getContextClassLoader
in interface ClassLoaderAware
Thread.getContextClassLoader()
public void setContextClassLoader(ClassLoader loader)
ClassLoaderAware
setContextClassLoader
in interface ClassLoaderAware
loader
- the context ClassLoader for this object