You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2021/06/13 16:50:00 UTC

[jira] [Updated] (IO-568) AutoCloseInputStream sometimes breaks mark/reset contract

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

Gary D. Gregory updated IO-568:
-------------------------------
    Fix Version/s:     (was: 2.10.0)
                   2.10.1

> AutoCloseInputStream sometimes breaks mark/reset contract
> ---------------------------------------------------------
>
>                 Key: IO-568
>                 URL: https://issues.apache.org/jira/browse/IO-568
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Streams/Writers
>    Affects Versions: 2.6
>            Reporter: Thomas Mortagne
>            Priority: Minor
>             Fix For: 2.10.1
>
>
> If the the inputstream support mark it should switch back from ClosedInputStream to initial InputStream and call reset on it.
> To reproduce:
> {code}
>         AutoCloseInputStream stream = new AutoCloseInputStream(new ByteArrayInputStream("toto".getBytes()));
>         stream.mark("toto".length());
>         while (stream.read(new byte[1]) != -1);
>         stream.reset();
> {code}
> Among other things it's causing TIKA-2395.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)