public interface MessageDecoder
DemuxingProtocolCodecFactory
,
MessageDecoderFactory
Modifier and Type | Field and Description |
---|---|
static MessageDecoderResult |
NEED_DATA
Represents a result from
decodable(ProtocolSession, ByteBuffer) and
decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput) . |
static MessageDecoderResult |
NOT_OK
Represents a result from
decodable(ProtocolSession, ByteBuffer) and
decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput) . |
static MessageDecoderResult |
OK
Represents a result from
decodable(ProtocolSession, ByteBuffer) and
decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput) . |
Modifier and Type | Method and Description |
---|---|
MessageDecoderResult |
decodable(ProtocolSession session,
ByteBuffer in)
Checks the specified buffer is decodable by this decoder.
|
MessageDecoderResult |
decode(ProtocolSession session,
ByteBuffer in,
ProtocolDecoderOutput out)
Decodes binary or protocol-specific content into higher-level message objects.
|
static final MessageDecoderResult OK
decodable(ProtocolSession, ByteBuffer)
and
decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)
. Please
refer to each method's documentation for detailed explanation.static final MessageDecoderResult NEED_DATA
decodable(ProtocolSession, ByteBuffer)
and
decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)
. Please
refer to each method's documentation for detailed explanation.static final MessageDecoderResult NOT_OK
decodable(ProtocolSession, ByteBuffer)
and
decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)
. Please
refer to each method's documentation for detailed explanation.MessageDecoderResult decodable(ProtocolSession session, ByteBuffer in)
MessageDecoderResult decode(ProtocolSession session, ByteBuffer in, ProtocolDecoderOutput out) throws ProtocolViolationException
decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput
.OK
if you finished decoding messages successfully.
NEED_DATA
if you need more data to finish decoding current message.
NOT_OK
if you cannot decode current message due to protocol specification violation.ProtocolViolationException
- if the read data violated protocol
specification