Package org.apache.avro.message
Class MessageDecoder.BaseDecoder<D>
java.lang.Object
org.apache.avro.message.MessageDecoder.BaseDecoder<D>
- Type Parameters:
D- a datum class
- All Implemented Interfaces:
MessageDecoder<D>
- Direct Known Subclasses:
BinaryMessageDecoder,RawMessageDecoder
- Enclosing interface:
MessageDecoder<D>
public abstract static class MessageDecoder.BaseDecoder<D>
extends Object
implements MessageDecoder<D>
Base class for
MessageEncoder implementations that provides default
implementations for most of the DatumEncoder API.
Implementations provided by this base class are thread-safe.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.avro.message.MessageDecoder
MessageDecoder.BaseDecoder<D> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode(byte[] encoded) Deserialize a single datum from a byte array.Deserialize a single datum from a byte array.decode(InputStream stream) Deserialize a single datum from an InputStream.decode(ByteBuffer encoded) Deserialize a single datum from a ByteBuffer.decode(ByteBuffer encoded, D reuse) Deserialize a single datum from a ByteBuffer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.avro.message.MessageDecoder
decode
-
Constructor Details
-
BaseDecoder
public BaseDecoder()
-
-
Method Details
-
decode
Description copied from interface:MessageDecoderDeserialize a single datum from an InputStream.- Specified by:
decodein interfaceMessageDecoder<D>- Parameters:
stream- stream to read from- Returns:
- a datum read from the stream
- Throws:
IOException
-
decode
Description copied from interface:MessageDecoderDeserialize a single datum from a ByteBuffer.- Specified by:
decodein interfaceMessageDecoder<D>- Parameters:
encoded- a ByteBuffer containing an encoded datum- Returns:
- a datum read from the stream
- Throws:
IOException
-
decode
Description copied from interface:MessageDecoderDeserialize a single datum from a byte array.- Specified by:
decodein interfaceMessageDecoder<D>- Parameters:
encoded- a byte array containing an encoded datum- Returns:
- a datum read from the stream
- Throws:
IOException
-
decode
Description copied from interface:MessageDecoderDeserialize a single datum from a ByteBuffer.- Specified by:
decodein interfaceMessageDecoder<D>- Parameters:
encoded- a ByteBuffer containing an encoded datumreuse- a datum instance to reuse, avoiding instantiation if possible- Returns:
- a datum read from the stream
- Throws:
IOException
-
decode
Description copied from interface:MessageDecoderDeserialize a single datum from a byte array.- Specified by:
decodein interfaceMessageDecoder<D>- Parameters:
encoded- a byte array containing an encoded datumreuse- a datum instance to reuse, avoiding instantiation if possible- Returns:
- a datum read from the stream
- Throws:
IOException
-