Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2E76E1076D for ; Mon, 22 Apr 2013 17:11:15 +0000 (UTC) Received: (qmail 19696 invoked by uid 500); 22 Apr 2013 17:11:14 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 19579 invoked by uid 500); 22 Apr 2013 17:11:14 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 19561 invoked by uid 99); 22 Apr 2013 17:11:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Apr 2013 17:11:14 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of garydgregory@gmail.com designates 209.85.214.53 as permitted sender) Received: from [209.85.214.53] (HELO mail-bk0-f53.google.com) (209.85.214.53) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Apr 2013 17:11:08 +0000 Received: by mail-bk0-f53.google.com with SMTP id jg9so362247bkc.40 for ; Mon, 22 Apr 2013 10:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=A1MhbuC/xzQKgwnv3WykqaY0JaNs+ZtCgYhpPnCf+pI=; b=rcJem9aZ83JvebnR9tRWxTFH5fWiZeHzvN3Gp/7eI6ciG3k+wX9q9vsD+k8eNU/dNM hh0zSQRufvD8Wv8ZdBhEFyxbz2/iCT0vHwv5risQ/dwo+xitOTo/3H881evlbmQvd3LL DQ8o7/82ot8rCTfzlYvzDvJsZTQaL2AyoT4YJ66n7llH2vRohigGCXVCUIrsAFSCaMC1 Lwd7cDzOUKW7Trh9ITFFcXMw5y/MNIL7TlrtqID7b/4uo/ThpqJQkI7CwngsMk2dU6dm 4r7Y7deXPJIr1hATzITtsNaLyIO37Ilf+hsC86w6gQhEUVBY7X098tou/C1u0AxQIhHn qGwQ== MIME-Version: 1.0 X-Received: by 10.205.41.72 with SMTP id tt8mr11938185bkb.9.1366650648360; Mon, 22 Apr 2013 10:10:48 -0700 (PDT) Received: by 10.204.32.71 with HTTP; Mon, 22 Apr 2013 10:10:48 -0700 (PDT) In-Reply-To: References: Date: Mon, 22 Apr 2013 13:10:48 -0400 Message-ID: Subject: Re: [IO] CharSequenceInputStream - strange code From: Gary Gregory To: Commons Developers List Content-Type: multipart/alternative; boundary=bcaec52997c16dacd504daf6262e X-Virus-Checked: Checked by ClamAV on apache.org --bcaec52997c16dacd504daf6262e Content-Type: text/plain; charset=UTF-8 I looked at this a couple of month ago and found it equally confusing. Gary On Mon, Apr 22, 2013 at 12:14 PM, sebb wrote: > I'm trying to fix IO-356, and having problems. > > I think this is because the code is a bit confused. > > The read() method reads bytes from the encoded byte buffer. > > However skip(int) skips the underlying CharBuf, and available() checks the > CharBuf > > I would expect read() and skip(1) to have the same effect (except possibly > at EOF). > However that is not the case currently. > > Also I would expect available() to relate to the number of characters > available for read(). > > The class extends InputStream, and I would expect all the > overridden/implemented methods to relate to the InputStream, not the source > Charset. > > Or am I missing something here? > -- E-Mail: garydgregory@gmail.com | ggregory@apache.org Java Persistence with Hibernate, Second Edition JUnit in Action, Second Edition Spring Batch in Action Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory --bcaec52997c16dacd504daf6262e--