Package org.nuxeo.lib.stream.codec
Class AvroMessageCodec<T>
- java.lang.Object
-
- org.nuxeo.lib.stream.codec.AvroMessageCodec<T>
-
- All Implemented Interfaces:
Codec<T>
public class AvroMessageCodec<T> extends Object implements Codec<T>
Avro Single object encoding: magic 2 bytes + schema fingerprint 8 bytes + avro binary. See https://avro.apache.org/docs/current/spec.html#single_object_encoding When using a SchemaStore the writer and reader schemas can evolve.- Since:
- 10.2
-
-
Constructor Summary
Constructors Constructor Description AvroMessageCodec(Class<T> messageClass)
AvroMessageCodec(Class<T> messageClass, AvroSchemaStore store)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
decode(byte[] data)
Decodes the byte array returns an object.byte[]
encode(T object)
Encodes the object returns a byte array representation.String
getName()
Returns the codec name
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
schema
protected final org.apache.avro.Schema schema
-
encoder
protected final org.apache.avro.message.BinaryMessageEncoder<T> encoder
-
decoder
protected final org.apache.avro.message.BinaryMessageDecoder<T> decoder
-
-
Constructor Detail
-
AvroMessageCodec
public AvroMessageCodec(Class<T> messageClass, AvroSchemaStore store)
-
-