commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Resolved] (IO-455) ReaderInputStream doesn't support marking
Date Fri, 05 Sep 2014 17:16:28 GMT


Sebb resolved IO-455.
    Resolution: Won't Fix

Simply delegating mark/reset to the input reader would not work.

This is because the class has to convert each input character into one or more bytes and these
bytes have to be buffered.
The class has to return any unused bytes before it can start re-reading from the Reader.

It would be possible to clear the buffer as part of the reset() method, but I'm not sure it
makes any sense to do this.
All the other methods operate on the byte stream; why should mark/reset operate on the Reader?
What is the use case for this?

It's easy enough to wrap the ReaderInputStream in a BufferedInputStream if you want to be
able to use mark/reset.

In any case, you can apply mark to the input by operating directly on the Reader.a

>  ReaderInputStream doesn't support marking
> ------------------------------------------
>                 Key: IO-455
>                 URL:
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Streams/Writers
>    Affects Versions: 2.4
>            Reporter: Marco Brandizi
> doesn't override markSupported() and mark(),
which essentially means it doesn't support marking at all. That doesn't seem necessary, since
it could just delegate it to the base reader. Indeed, I've discovered this problem while wrapping
a StringReader (which instead supports marking).

This message was sent by Atlassian JIRA

View raw message