commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mortagne (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IO-568) AutoCloseInputStream crash on reset() when reading the whole does not support InputStream#stream
Date Wed, 07 Feb 2018 09:22:00 GMT

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

Thomas Mortagne updated IO-568:
-------------------------------
    Description: 
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}

  was:
If the the inputstream support mark it should switch back from ClosedInputStream to initial
InputStream and call reset on it.

To reproduce:

{code}


> AutoCloseInputStream crash on reset() when reading the whole does not support InputStream#stream
> ------------------------------------------------------------------------------------------------
>
>                 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.7
>
>
> 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}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message