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