mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat <forum.maill...@gmail.com>
Subject Re: MessageDecoderResult.OK
Date Wed, 03 Oct 2007 03:19:41 GMT
No, Trustin. I was asking about actually how Mina handle this internally?
Too lazy to read the source code.^^

On 10/2/07, Trustin Lee <trustin@gmail.com> wrote:
>
> On 10/2/07, mat <forum.maillist@gmail.com> wrote:
> > After MessageDecoderResult.OK in decode(), what mina handle ByteBuffer
> > in? Remove the remaining byte[] in ByteBuffer to new position? Or
> ByteBuffer
> > has special function can do this?
>
> It often retains the reference to the buffer calling compact() and
> flip().  It sometimes replaces the buffer received from the previous
> filter in the chain.  It's because the decoder implementation is
> optimized to minimize memory copy.  So you can't assume about its
> internal behavior.  Please do not try to modify the content of the
> buffer (e.g. calling buffer.compact()); MINA will do that for you.
> Plus, please do not assume that the buffer's position is always 0.  It
> can vary depending on situation.
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message