public abstract class SerializationCodec<E,IN,OUT> extends java.lang.Object implements Codec<Buffer,IN,OUT>
Codec Codecs that perform serialization of objects. Optionally handles writing class
names so that an object that is serialized can be properly instantiated with full type information on the other end.| Modifier | Constructor and Description |
|---|---|
protected |
SerializationCodec(E engine,
boolean lengthFieldFraming)
Create a
SerializationCodec using the given engine and specifying whether or not to prepend a length field
to frame the message. |
| Modifier and Type | Method and Description |
|---|---|
Function<Buffer,IN> |
decoder(Consumer<IN> next)
Provide the caller with a decoder to turn a source object into an instance of the input
type.
|
protected abstract Function<byte[],IN> |
deserializer(E engine,
java.lang.Class<IN> type,
Consumer<IN> next) |
Function<OUT,Buffer> |
encoder()
Provide the caller with an encoder to turn an output object into an instance of the source
type.
|
protected E |
getEngine() |
java.lang.Class<IN> |
readType(Buffer buffer) |
protected abstract Function<OUT,byte[]> |
serializer(E engine) |
protected SerializationCodec(E engine, boolean lengthFieldFraming)
SerializationCodec using the given engine and specifying whether or not to prepend a length field
to frame the message.engine - the engine which will perform the serializationlengthFieldFraming - true to prepend a length field, or false to skippublic Function<Buffer,IN> decoder(Consumer<IN> next)
Codecpublic Function<OUT,Buffer> encoder()
Codecprotected E getEngine()
protected abstract Function<byte[],IN> deserializer(E engine, java.lang.Class<IN> type, Consumer<IN> next)