public class BytesSerializer extends java.lang.Object implements Serializer<org.apache.kafka.common.utils.Bytes>
Constructor and Description |
---|
BytesSerializer() |
Modifier and Type | Method and 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,
org.apache.kafka.common.utils.Bytes data)
Convert
data into a byte array. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
serialize
public void configure(java.util.Map<java.lang.String,?> configs, boolean isKey)
Serializer
configure
in interface Serializer<org.apache.kafka.common.utils.Bytes>
configs
- configs in key/value pairsisKey
- whether is for key or valuepublic byte[] serialize(java.lang.String topic, org.apache.kafka.common.utils.Bytes data)
Serializer
data
into a byte array.serialize
in interface Serializer<org.apache.kafka.common.utils.Bytes>
topic
- topic associated with datadata
- typed datapublic void close()
Serializer
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface Serializer<org.apache.kafka.common.utils.Bytes>