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 2022/06/20 13:42:00 UTC

[jira] [Closed] (IO-587) BoundedInputStream: Expose method to check whether the boundary was reached

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

Gary D. Gregory closed IO-587.
------------------------------
    Resolution: Fixed

This is already supported by {{available()}} when returns {{0}}.

> BoundedInputStream: Expose method to check whether the boundary was reached
> ---------------------------------------------------------------------------
>
>                 Key: IO-587
>                 URL: https://issues.apache.org/jira/browse/IO-587
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Streams/Writers
>    Affects Versions: 2.6
>            Reporter: Konrad Windszus
>            Priority: Major
>
> It would be nice to have an additional method on the {{BoundedInputStream}} which allows to check if the boundary was reached after the input stream was consumed.
> This is e.g. useful if you use {{BoundedInputStream}} together with {{IOUtils.toString(...)}} to prevent too large input streams from ending up in the heap. In that case you are interested to at least log something or even throw an exception if the boundary was hit.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)