commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [IO] CharSequenceInputStream - strange code
Date Wed, 24 Apr 2013 00:27:08 GMT
On 22 April 2013 18:10, Gary Gregory <garydgregory@gmail.com> wrote:

> I looked at this a couple of month ago and found it equally confusing.
>
>
I think I've finally sorted out the issues...

skip() now skips the byte buffer (i.e. the same buffer as read) and AFAICT
mark/reset is working OK.
Also available() does now include the encoded bytes in the count
(previously the count was 0 if the last chunk of input had been encoded)

There are still some @Ignored tests - these relate to multi-byte charsets.
Not sure if the tests can be fixed (or indeed if they would serve any
additional purpose).

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