Return-Path: Delivered-To: apmail-cassandra-dev-archive@www.apache.org Received: (qmail 74969 invoked from network); 24 Nov 2010 00:10:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Nov 2010 00:10:11 -0000 Received: (qmail 42681 invoked by uid 500); 24 Nov 2010 00:10:41 -0000 Delivered-To: apmail-cassandra-dev-archive@cassandra.apache.org Received: (qmail 42659 invoked by uid 500); 24 Nov 2010 00:10:41 -0000 Mailing-List: contact dev-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list dev@cassandra.apache.org Received: (qmail 42651 invoked by uid 99); 24 Nov 2010 00:10:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Nov 2010 00:10:41 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.216.44] (HELO mail-qw0-f44.google.com) (209.85.216.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Nov 2010 00:10:33 +0000 Received: by qwc9 with SMTP id 9so128660qwc.31 for ; Tue, 23 Nov 2010 16:10:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.222.212 with SMTP id ih20mr6928594qcb.121.1290557412163; Tue, 23 Nov 2010 16:10:12 -0800 (PST) Received: by 10.229.142.79 with HTTP; Tue, 23 Nov 2010 16:10:12 -0800 (PST) X-Originating-IP: [76.253.75.188] In-Reply-To: References: Date: Tue, 23 Nov 2010 18:10:12 -0600 Message-ID: Subject: Re: Question about ByteBuffer positions From: Nate McCall To: dev@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 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 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? =A0I= 've > tried to trace anything that calls the new method signatures in AbstractT= ype > and really couldn't tell. > > Ed >