Hi Bogdan,

On Jan 18, 2008 8:06 PM, Bogdan Ciprian Pistol <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Suppose that in a decode(IoSession session, IoBuffer in,
> ProtocolDecoderOutput out) call the IoBuffer is read and some objects
> are written to the ProtocolDecoderOutput. Suppose that the IoBuffer
> contains some more data, but not enough for creating another object
> (to write to the ProtocolDecoderOutput), so I return
> MessageDecoderResult.NEED_DATA.

You are just safe to return MessageDecoderResult.OK after decoding
only one message.  decode() will be invoked again and again until you
return NEED_DATA.

> What will the IoBuffer contain when more data is available ?
> The old not enough remaining data + the new available data ?

Yes.  You can get the IoBuffer with non-zero position.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to