public void decode(IoSessionsession,
IoBufferin,
ProtocolDecoderOutputout)
throws Exception
Cumulates content of in into internal buffer and forwards
decoding request to doDecode(IoSession, IoBuffer, ProtocolDecoderOutput).
doDecode() is invoked repeatedly until it returns false
and the cumulative buffer is compacted after decoding ends.
Throws:
IllegalStateException- if your
doDecode() returned
true not consumingthe cumulative buffer.
Exception - ifthe read data violated protocol specification
Implement this method to consume the specified cumulativebuffer and decode its content into message(s).
Parameters:
in - the cumulative buffer
Returns:
true if and only if there's more to decode in thebuffer and you want to have
doDecode method invoked again.Return
false if remaining data is not enough to decode,then this method will be invoked again when more data iscumulated.