public final class ProtobufMessageDecoder<IN extends com.google.protobuf.GeneratedMessage> extends IoBufferDecoder<IN>
Modifier and Type | Method and Description |
---|---|
IN |
decode(IoBuffer input)
Decodes a message from a
IoBuffer
When a truncated input is given to this method it may return null. |
static <TYPE extends com.google.protobuf.GeneratedMessage> |
newInstance(Class<TYPE> c) |
static <TYPE extends com.google.protobuf.GeneratedMessage> |
newInstance(Class<TYPE> c,
com.google.protobuf.ExtensionRegistryLite registry) |
createDecoderState, decode, finishDecode
public static <TYPE extends com.google.protobuf.GeneratedMessage> ProtobufMessageDecoder<TYPE> newInstance(Class<TYPE> c) throws NoSuchMethodException
NoSuchMethodException
public static <TYPE extends com.google.protobuf.GeneratedMessage> ProtobufMessageDecoder<TYPE> newInstance(Class<TYPE> c, com.google.protobuf.ExtensionRegistryLite registry) throws NoSuchMethodException
NoSuchMethodException
public IN decode(IoBuffer input)
IoBufferDecoder
IoBuffer
When a truncated input is given to this method it may return null. Not all decoder will be able to detect this issue and report it that way. Thanks to prefixing of messages, decoder will only receive appropriately sized ByteBuffers.
n.b. The decoders used for the prefixing (i.e. RawInt32
and
VarInt
) have to detect truncated ByteBuffers.
decode
in class IoBufferDecoder<IN extends com.google.protobuf.GeneratedMessage>
input
- data to be decoded as a TYPE messageCopyright © 2009–2013 Apache MINA Project. All rights reserved.