public abstract class Serializer extends Object
In order to support pluggable serialization, Dempsy (the container and the distributor) can be configured with a serialization scheme. Note, the serialize call is used on the output side and the deserialize is used on the input side but this interface defines them both right now to make it easy to plug in different implementations without managing many objects.
The implementation should be thread safe.Constructor and Description |
---|
Serializer() |
Modifier and Type | Method and Description |
---|---|
<T> T |
deserialize(byte[] data,
Class<T> clazz) |
abstract <T> T |
deserialize(MessageBufferInput is,
Class<T> clazz) |
<T> byte[] |
serialize(T object) |
abstract <T> void |
serialize(T object,
MessageBufferOutput buf) |
public abstract <T> void serialize(T object, MessageBufferOutput buf) throws IOException
IOException
public abstract <T> T deserialize(MessageBufferInput is, Class<T> clazz) throws IOException
IOException
public <T> byte[] serialize(T object) throws IOException
IOException
public <T> T deserialize(byte[] data, Class<T> clazz) throws IOException
IOException
Copyright © 2018. All rights reserved.