Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 38428 invoked from network); 26 Apr 2006 08:25:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Apr 2006 08:25:25 -0000 Received: (qmail 13897 invoked by uid 500); 26 Apr 2006 08:25:25 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 13865 invoked by uid 500); 26 Apr 2006 08:25:25 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 13849 invoked by uid 99); 26 Apr 2006 08:25:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2006 01:25:25 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2006 01:25:24 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3A36E7142BD for ; Wed, 26 Apr 2006 08:25:03 +0000 (GMT) Message-ID: <61462370.1146039903227.JavaMail.root@brutus> Date: Wed, 26 Apr 2006 08:25:03 +0000 (GMT+00:00) From: "Vladimir Strigun (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-410) method decode(ByteBuffer, CharBuffer, boolean) should set correct position in ByteBuffer In-Reply-To: <26743277.1145975945687.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-410?page=comments#action_12376425 ] Vladimir Strigun commented on HARMONY-410: ------------------------------------------ Hi Richard, Thanks for the clarification, I agree that streaming decode is good thing, but I'd like to explain my understanding of specification :) According to specification of CharsetDecoder decoding operation should process by the following steps: " 2. Invoke the decode method zero or more times, as long as additional input may be available, passing false for the endOfInput argument and filling the input buffer and flushing the output buffer between invocations; 3. Invoke the decode method one final time, passing true for the endOfInput argument; and then " spec also says: "The buffers' positions will be advanced to reflect the bytes read and the characters written, but their marks and limits will not be modified" I understand these sentences in the next way: invoke decode with endOfInput = false if you have additional input, then fill the buffer (i.e. add to buffer some additional input), invoke decode again and pass correct endOfInput parameter dependent of availability of input. Example you provided is very useful and, of course, 1st option looks better, but what I'm suggest here is to reflect actual processed bytes in input. After first invocation of decode, not all bytes processed actually, i.e. almost all bytes processed, but some stored in decoder to further operation. Is it possible to store bytes in decoder, support streaming decoding, and, at the same time sets correct position in input buffer after each operation? Thanks. Vladimir. > method decode(ByteBuffer, CharBuffer, boolean) should set correct position in ByteBuffer > ---------------------------------------------------------------------------------------- > > Key: HARMONY-410 > URL: http://issues.apache.org/jira/browse/HARMONY-410 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Vladimir Strigun > Assignee: Mikhail Loenko > Priority: Minor > Attachments: Harmony-410_patch.txt, harmony-410_test.txt > > When ByteBuffer contain incomplete sequence of bytes for successful decoding, position in ByteBuffer should be set to latest successful byte. I will attach testcase and patch soon. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira