Interface Codec<T>

All Known Implementing Classes:
AvroBinaryCodec, AvroConfluentCodec, AvroJsonCodec, AvroMessageCodec, AvroRecordCodec, NoCodec, SerializableCodec

public interface Codec<T>
Convert an object to/from byte array. The implementation should be thread safe.
Since:
10.2
  • Method Summary

    Modifier and Type
    Method
    Description
    decode(byte[] data)
    Decodes the byte array returns an object.
    byte[]
    encode(T object)
    Encodes the object returns a byte array representation.
    Returns the codec name
  • Method Details

    • getName

      String getName()
      Returns the codec name
    • encode

      byte[] encode(T object)
      Encodes the object returns a byte array representation.
    • decode

      T decode(byte[] data)
      Decodes the byte array returns an object.
      Throws:
      IllegalArgumentException - if data are invalid.