public interface SessionSerializer
The SessionModule
provides a default implementation that uses Java's in built serialization.
JavaSessionSerializer
Modifier and Type | Method and Description |
---|---|
<T> T |
deserialize(Class<T> type,
InputStream in)
Reads the bytes of the given input stream, creating a new object.
|
<T> void |
serialize(Class<T> type,
T value,
OutputStream out)
Writes the given value to the output stream as bytes.
|
<T> void serialize(Class<T> type, T value, OutputStream out) throws Exception
T
- the type of the objecttype
- the declared type of the objectvalue
- the value to serializeout
- the destination for the bytesException
- if the value could not be serialized<T> T deserialize(Class<T> type, InputStream in) throws Exception
T
- the type of the objecttype
- the expected type of the objectin
- the source of the bytesIOException
- any thrown by in
Exception
- the the value could not be deserialized