You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Ed Anuff <ed...@anuff.com> on 2010/11/24 00:42:15 UTC

Question about ByteBuffer positions

Is it safe to assume that anywhere that you're provided with a ByteBuffer
that it's ok to leave it's position wherever you want or should you be
calling buffer.duplicate() and working with your copy of the buffer?  I've
tried to trace anything that calls the new method signatures in AbstractType
and really couldn't tell.

Ed

Re: Question about ByteBuffer positions

Posted by Nate McCall <na...@riptano.com>.
for your own code, I would stay with duplicate(), slice() and similar
and just assume we will do something fancier than we currently are one
day. The overhead of those methods is really small as it's just
pointers to the same underlying buffer.

On Tue, Nov 23, 2010 at 5:42 PM, Ed Anuff <ed...@anuff.com> wrote:
> Is it safe to assume that anywhere that you're provided with a ByteBuffer
> that it's ok to leave it's position wherever you want or should you be
> calling buffer.duplicate() and working with your copy of the buffer?  I've
> tried to trace anything that calls the new method signatures in AbstractType
> and really couldn't tell.
>
> Ed
>