public class ByteBufferSerializer extends Object implements Serializer<ByteBuffer>
ByteBufferSerializer
always rewinds
the position of the input buffer to zero for
serialization. A manual rewind is not necessary.
Note: any existing buffer position is ignored.
The position is also rewound back to zero before serialize(String, ByteBuffer)
returns.
Constructor and Description |
---|
ByteBufferSerializer() |
Modifier and Type | Method and Description |
---|---|
byte[] |
serialize(String topic,
ByteBuffer data)
Convert
data into a byte array. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, configure, serialize
public byte[] serialize(String topic, ByteBuffer data)
Serializer
data
into a byte array.serialize
in interface Serializer<ByteBuffer>
topic
- topic associated with datadata
- typed data