Package org.apache.avro.message
Interface MessageEncoder<D>
- Type Parameters:
D
- a datum class
- All Known Implementing Classes:
BinaryMessageEncoder
,RawMessageEncoder
public interface MessageEncoder<D>
Serializes an individual datum as a ByteBuffer or to an OutputStream.
-
Method Summary
Modifier and TypeMethodDescriptionSerialize a single datum to a ByteBuffer.void
encode
(D datum, OutputStream stream) Serialize a single datum to an OutputStream.
-
Method Details
-
encode
Serialize a single datum to a ByteBuffer.- Parameters:
datum
- a datum- Returns:
- a ByteBuffer containing the serialized datum
- Throws:
IOException
-
encode
Serialize a single datum to an OutputStream.- Parameters:
datum
- a datumstream
- an OutputStream to serialize the datum to- Throws:
IOException
-