public class ByteBufferSerializer extends Object implements Serializer<ByteBuffer>
Constructor and Description |
---|
ByteBufferSerializer() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this serializer.
|
void |
configure(Map<String,?> configs,
boolean isKey)
Configure this class.
|
byte[] |
serialize(String topic,
ByteBuffer data)
Convert
data into a byte array. |
public void configure(Map<String,?> configs, boolean isKey)
Serializer
configure
in interface Serializer<ByteBuffer>
configs
- configs in key/value pairsisKey
- whether is for key or valuepublic byte[] serialize(String topic, ByteBuffer data)
Serializer
data
into a byte array.serialize
in interface Serializer<ByteBuffer>
topic
- topic associated with datadata
- typed datapublic void close()
Serializer
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Serializer<ByteBuffer>