public interface Serializer
Central interface for message serialization/deserialization. Knows how to serialize an object to a stream, and how to get an object from a stream.
To add support for custom serialization mechanism, implement this interface and then use its instance on client and server sides.
XStreamSerializer| Modifier and Type | Method and Description |
|---|---|
<T> T |
deserialize(InputStream is)
Deserializes an object an
InputStream. |
void |
serialize(Object object,
OutputStream os)
Serializes an object to an
OutputStream. |
void serialize(Object object, OutputStream os) throws SerializationException, IOException
OutputStream.object - object to serializeos - output stream to which to serializeSerializationException - if something specific to serializer
happened during the serializationIOException - if input/output error happened<T> T deserialize(InputStream is) throws SerializationException, IOException
InputStream.T - returned typeis - input stream from which to deserializeSerializationException - if something specific to serializer
happened during the serializationIOException - if input/output error happenedCopyright © 2015. All rights reserved.