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.

Functions

Link copied to clipboard
abstract fun <T : Any> deserialize(bytes: ByteSequence, clazz: Class<T>, context: SerializationSchemeContext): T

This method must deserialize the data stored bytes into an instance of T.

Link copied to clipboard
abstract fun getSchemeId(): Int

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.

Link copied to clipboard
abstract fun <T : Any> serialize(obj: T, context: SerializationSchemeContext): ByteSequence

This method must be able to serialize any object T into a ByteSequence.