K - Key type to be serialized from.
A class that implements this interface is expected to have a constructor with no parameter.
public interface Serializer<K,V> extends org.apache.kafka.common.Configurable, Serializable, Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this serializer
|
K |
deserializeKey(byte[] key) |
V |
deserializeValue(K key,
byte[] value) |
byte[] |
serializeKey(K key) |
byte[] |
serializeValue(V value) |
byte[] serializeKey(K key) throws SerializationException
key - Typed keySerializationExceptionbyte[] serializeValue(V value) throws SerializationException
value - Typed valueSerializationExceptionK deserializeKey(byte[] key) throws SerializationException
key - Bytes of the serialized keySerializationExceptionV deserializeValue(K key, byte[] value) throws SerializationException
key - Typed key corresponding to this valuevalue - Bytes of the serialized valueSerializationExceptionvoid close()
close in interface AutoCloseableclose in interface CloseableCopyright © 2026 Confluent, Inc.. All rights reserved.