Class AvroBinaryCodec<T>

java.lang.Object
org.nuxeo.lib.stream.codec.AvroBinaryCodec<T>
All Implemented Interfaces:
Codec<T>

public class AvroBinaryCodec<T> extends Object implements Codec<T>
Avro Binary format, there is no header, the schema must be the same for encoder and decoder.
Since:
10.2
  • Field Details

    • NAME

      public static final String NAME
      See Also:
    • messageClass

      protected final Class<T> messageClass
    • schema

      protected final org.apache.avro.Schema schema
    • encoder

      protected final org.apache.avro.message.RawMessageEncoder<T> encoder
    • decoder

      protected final org.apache.avro.message.RawMessageDecoder<T> decoder
  • Constructor Details

    • AvroBinaryCodec

      public AvroBinaryCodec(Class<T> messageClass)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Codec
      Returns the codec name
      Specified by:
      getName in interface Codec<T>
    • encode

      public byte[] encode(T object)
      Description copied from interface: Codec
      Encodes the object returns a byte array representation.
      Specified by:
      encode in interface Codec<T>
    • decode

      public T decode(byte[] data)
      Description copied from interface: Codec
      Decodes the byte array returns an object.
      Specified by:
      decode in interface Codec<T>