public abstract class AbstractMessageDecoder extends java.lang.Object implements MessageDecoder
MessageDecoder
that decodes message header and forwards
the decoding of body to a subclass.NEED_DATA, NOT_OK, OK
限定符 | 构造器和说明 |
---|---|
protected |
AbstractMessageDecoder(int type) |
限定符和类型 | 方法和说明 |
---|---|
MessageDecoderResult |
decodable(IoSession session,
ByteBuffer in)
Checks the specified buffer is decodable by this decoder.
|
MessageDecoderResult |
decode(IoSession session,
ByteBuffer in,
ProtocolDecoderOutput out)
Decodes binary or protocol-specific content into higher-level message objects.
|
protected abstract AbstractMessage |
decodeBody(IoSession session,
ByteBuffer in) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
finishDecode
public MessageDecoderResult decodable(IoSession session, ByteBuffer in)
MessageDecoder
decodable
在接口中 MessageDecoder
MessageDecoder.OK
if this decoder can decode the specified buffer.
MessageDecoder.NOT_OK
if this decoder cannot decode the specified buffer.
MessageDecoder.NEED_DATA
if more data is required to determine if the
specified buffer is decodable (MessageDecoder.OK
) or not decodable
MessageDecoder.NOT_OK
.public MessageDecoderResult decode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws java.lang.Exception
MessageDecoder
MessageDecoder.decode(IoSession, ByteBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput
.decode
在接口中 MessageDecoder
MessageDecoder.OK
if you finished decoding messages successfully.
MessageDecoder.NEED_DATA
if you need more data to finish decoding current message.
MessageDecoder.NOT_OK
if you cannot decode current message due to protocol specification violation.java.lang.Exception
- if the read data violated protocol specificationprotected abstract AbstractMessage decodeBody(IoSession session, ByteBuffer in)