Le 6/16/13 9:31 PM, Raphaël Barazzutti a écrit :
> Hi Julien,
>
> Thanks for your comments!
>
> You're right there are not that much differences between that two classes.
>
> In some situations I find IoBuffer very interesting, but in the case
> of a decoder there are some concepts taken from ByteBuffer that in my
> opinion don't fit very well.
>
> Lets describe briefly a case: In a decoder, the IoBuffer could be used
> as a connection's buffer, then a given instance would be the context
> of the connection. That buffer would be somehow used as a queue and
> the position p0 would be the first byte of the communication. After
> having enough bytes to process a message, the position would be moved
> to position p1. Then we can expect that the buffer release the byte
> buffer(s) containing the bytes in the range between p0 and p1. Then it
> becomes a bit complicated to define the behaviour of position(int)
> when a call to position(p0) is done.
We just need to implement the slice() method in the IoBuffer to offer
the kind of features you expect.
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
|