com.googlecode.xremoting.core.spi
Interface Serializer

All Known Implementing Classes:
XStreamSerializer

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.

Author:
Roman Puchkovskiy
See Also:
XStreamSerializer

Method Summary
<T> T
deserialize(InputStream is)
          Deserializes an object an InputStream.
 void serialize(Object object, OutputStream os)
          Serializes an object to an OutputStream.
 

Method Detail

serialize

void serialize(Object object,
               OutputStream os)
               throws SerializationException,
                      IOException
Serializes an object to an OutputStream.

Parameters:
object - object to serialize
os - output stream to which to serialize
Throws:
SerializationException - if something specific to serializer happened during the serialization
IOException - if input/output error happened

deserialize

<T> T deserialize(InputStream is)
              throws SerializationException,
                     IOException
Deserializes an object an InputStream.

Type Parameters:
T - returned type
Parameters:
is - input stream from which to deserialize
Returns:
deserialized object
Throws:
SerializationException - if something specific to serializer happened during the serialization
IOException - if input/output error happened


Copyright © 2011. All Rights Reserved.