You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2014/09/05 19:16:28 UTC

[jira] [Resolved] (IO-455) ReaderInputStream doesn't support marking

     [ https://issues.apache.org/jira/browse/IO-455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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: https://issues.apache.org/jira/browse/IO-455
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Streams/Writers
>    Affects Versions: 2.4
>            Reporter: Marco Brandizi
>
> org.apache.commons.io.input.ReaderInputStream 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
(v6.3.4#6332)