Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 78431 invoked from network); 17 Mar 2008 11:35:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Mar 2008 11:35:49 -0000 Received: (qmail 2309 invoked by uid 500); 17 Mar 2008 11:35:45 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 2284 invoked by uid 500); 17 Mar 2008 11:35:45 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 2275 invoked by uid 99); 17 Mar 2008 11:35:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Mar 2008 04:35:45 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of t.p.ellison@gmail.com designates 64.233.184.235 as permitted sender) Received: from [64.233.184.235] (HELO wr-out-0506.google.com) (64.233.184.235) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Mar 2008 11:35:06 +0000 Received: by wr-out-0506.google.com with SMTP id c46so4346057wra.18 for ; Mon, 17 Mar 2008 04:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; bh=dkAES4xcRxxuPqKmyuCoLihunqKJEsQlSK6/lwUG8qs=; b=HkKtxugtHmh6P8Zq8Pm6rII3ENcQ3Tj3RBviUBCm3CvhE0Lw98DeAFqpUP0R6CKyVWcQadW3MUa9SfU0eMHP/GBjw/zXbrFir23Y3IWdKAVChElTFgHL6xRSrKWWneHH7xzyiWNkSpveSJvcBEXlNS/irqxUOgg32RahVJfbW18= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=P3/JypwN9/F3RtACFds3HkaV4EGc0TmGdCwIerm69KOUxVp+aRPkqd6NGzen6/0cqisHtEoz79V9w7B7dL0jImm1W8dpqEUHlNGATtkBrZXC4veyvO/dno+wb+HnbdeYums984bBs6aW+DWRygF2ahwvu8B8O255tQcivxFypds= Received: by 10.114.152.17 with SMTP id z17mr17491926wad.128.1205753617756; Mon, 17 Mar 2008 04:33:37 -0700 (PDT) Received: from ?9.20.183.162? ( [195.212.29.83]) by mx.google.com with ESMTPS id q40sm11622976ugc.70.2008.03.17.04.33.35 (version=SSLv3 cipher=RC4-MD5); Mon, 17 Mar 2008 04:33:36 -0700 (PDT) Message-ID: <47DE570E.2080407@gmail.com> Date: Mon, 17 Mar 2008 11:33:34 +0000 From: Tim Ellison User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: [classlib][luni] optimized InputStream reader (HARMONY-5522) References: <55813256.1205414746292.JavaMail.jira@brutus> <47D93B38.8000100@gmail.com> <47D94257.90706@gmail.com> <47DAAC37.8080505@gmail.com> <47DD7A36.9070209@gmail.com> In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Alexei Fedotov wrote: > As for [1], it seems the following should be done under synchronized > (bais) {}. Imagine the thread will switch right after bais.pos check > and someone will read few bytes from the stream. In this case only a > part of the buffer should be returned. > > if (bais.pos == 0) { > bais.skip(bais.buf.length); > return bais.buf; > } > > [1] http://issues.apache.org/jira/secure/attachment/12378007/ByteStream.java Agreed. Tim