public CustomSerializationScheme
Implement this interface to add your own Serialization Scheme. This is an experimental feature. All methods in this class MUST be thread safe i.e. methods from the same instance of this class can be called in different threads simultaneously.
Modifier and Type | Method and Description |
---|---|
<T> T |
deserialize(ByteSequence bytes,
java.lang.Class<T> clazz,
SerializationSchemeContext context)
This method must deserialize the data stored bytes into an instance of T.
|
int |
getSchemeId()
This method must return an id used to uniquely identify the Scheme. This should be unique within a network as serialized data might
be sent over the wire.
|
<T> ByteSequence |
serialize(T obj,
SerializationSchemeContext context)
This method must be able to serialize any object T into a ByteSequence.
|
int getSchemeId()
This method must return an id used to uniquely identify the Scheme. This should be unique within a network as serialized data might be sent over the wire.
<T> T deserialize(ByteSequence bytes, java.lang.Class<T> clazz, SerializationSchemeContext context)
This method must deserialize the data stored bytes into an instance of T.
bytes
- the serialized data.clazz
- the class to instantiate.context
- used to pass information about how the object should be deserialized.<T> ByteSequence serialize(T obj, SerializationSchemeContext context)
This method must be able to serialize any object T into a ByteSequence.
obj
- the object to be serialized.context
- used to pass information about how the object should be serialized.