Package org.nuxeo.lib.stream.codec
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
All Methods Instance Methods Abstract 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
-
-
-
Method Detail
-
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.
-
-