public class SerializationDelegate extends java.lang.Object implements Serializer<java.lang.Object>, Deserializer<java.lang.Object>
Serializer and Deserializer
itself, so can also be passed into such more specific callback methods.| Constructor and Description |
|---|
SerializationDelegate(java.lang.ClassLoader classLoader)
Create a
SerializationDelegate with a default serializer/deserializer
for the given ClassLoader. |
SerializationDelegate(Serializer<java.lang.Object> serializer,
Deserializer<java.lang.Object> deserializer)
Create a
SerializationDelegate with the given serializer/deserializer. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
deserialize(java.io.InputStream inputStream)
Read (assemble) an object of type T from the given InputStream.
|
void |
serialize(java.lang.Object object,
java.io.OutputStream outputStream)
Write an object of type T to the given OutputStream.
|
public SerializationDelegate(java.lang.ClassLoader classLoader)
SerializationDelegate with a default serializer/deserializer
for the given ClassLoader.public SerializationDelegate(Serializer<java.lang.Object> serializer, Deserializer<java.lang.Object> deserializer)
SerializationDelegate with the given serializer/deserializer.serializer - the Serializer to use (never null)deserializer - the Deserializer to use (never null)public void serialize(java.lang.Object object,
java.io.OutputStream outputStream)
throws java.io.IOException
SerializerNote: Implementations should not close the given OutputStream (or any decorators of that OutputStream) but rather leave this up to the caller.
serialize in interface Serializer<java.lang.Object>object - the object to serializeoutputStream - the output streamjava.io.IOException - in case of errors writing to the streampublic java.lang.Object deserialize(java.io.InputStream inputStream)
throws java.io.IOException
DeserializerNote: Implementations should not close the given InputStream (or any decorators of that InputStream) but rather leave this up to the caller.
deserialize in interface Deserializer<java.lang.Object>inputStream - the input streamjava.io.IOException - in case of errors reading from the stream