D
- a datum classpublic abstract static class MessageDecoder.BaseDecoder<D> extends Object implements MessageDecoder<D>
MessageEncoder
implementations that provides default
implementations for most of the DatumEncoder
API.
Implementations provided by this base class are thread-safe.
MessageDecoder.BaseDecoder<D>
Constructor and Description |
---|
MessageDecoder.BaseDecoder() |
Modifier and Type | Method and Description |
---|---|
D |
decode(byte[] encoded)
Deserialize a single datum from a byte array.
|
D |
decode(byte[] encoded,
D reuse)
Deserialize a single datum from a byte array.
|
D |
decode(ByteBuffer encoded)
Deserialize a single datum from a ByteBuffer.
|
D |
decode(ByteBuffer encoded,
D reuse)
Deserialize a single datum from a ByteBuffer.
|
D |
decode(InputStream stream)
Deserialize a single datum from an InputStream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode
public D decode(InputStream stream) throws IOException
MessageDecoder
decode
in interface MessageDecoder<D>
stream
- stream to read fromIOException
public D decode(ByteBuffer encoded) throws IOException
MessageDecoder
decode
in interface MessageDecoder<D>
encoded
- a ByteBuffer containing an encoded datumIOException
public D decode(byte[] encoded) throws IOException
MessageDecoder
decode
in interface MessageDecoder<D>
encoded
- a byte array containing an encoded datumIOException
public D decode(ByteBuffer encoded, D reuse) throws IOException
MessageDecoder
decode
in interface MessageDecoder<D>
encoded
- a ByteBuffer containing an encoded datumreuse
- a datum instance to reuse, avoiding instantiation if possibleIOException
public D decode(byte[] encoded, D reuse) throws IOException
MessageDecoder
decode
in interface MessageDecoder<D>
encoded
- a byte array containing an encoded datumreuse
- a datum instance to reuse, avoiding instantiation if possibleIOException
Copyright © 2009–2017 The Apache Software Foundation. All rights reserved.