commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [IO] CharSequenceInputStream - strange code
Date Mon, 22 Apr 2013 17:10:48 GMT
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 <sebbaz@gmail.com> 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<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message