commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] Commented: (IO-152) Add ByteArrayOutputStream.readFrom(InputStream)
Date Sun, 06 Jan 2008 21:34:34 GMT


Niall Pemberton commented on IO-152:

I understand the logical symmetry, but it still seems wrong that what is essentially a "write"
method method is named "read" rather than "write" and I do think it fits in eactly with all
the other "write" methods. On the IOException point then we should make this clear in the

> Add ByteArrayOutputStream.readFrom(InputStream)
> -----------------------------------------------
>                 Key: IO-152
>                 URL:
>             Project: Commons IO
>          Issue Type: New Feature
>          Components: Streams/Writers
>            Reporter: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.4
>         Attachments: IO-152.patch
> It would be useful to have a ByteArrayOutputStream.readFrom(InputStream) method to mirror
the existing writeTo(OutputStream) method. A call like baos.readFrom(in) would be semantically
the same as IOUtils.copy(in, baos), but would avoid an extra in-memory copy of the stream
contents, as it could read bytes from the input stream directly into the internal ByteArrayOutputStream

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message