Library enhancement proposal for copying data from/to Reader/Writer InputStream/OutputStream
Patrick Reinhart
patrick at reini.net
Thu Nov 27 09:40:32 UTC 2014
Hi Paul,
Attached a patch containing my complete proposed code including tests.
Patrick
> Am 24.11.2014 um 18:03 schrieb Patrick Reinhart <patrick at reini.net>:
>
> Well I will then suggest using IOUtils with two simple methods:
>
> public static long copy(InputStream source, OutputStream target)
>
> public static long copy(Readable source, Appendable target)
>
>
>>>>
>>>> To speed things along for now i recommend creating a new class say IOUtils or preferably ByteStreams.
>>>
>>> Hmm, in the case of Reader/Writer ByteStreams seams to be a bit confusing for me, should then the reader copy stuff go to also a separate class like „CharStreams“. Locally I created an implementation named „IOUtils“ containing a copy method for InputStream to OutputStream.
>>>
>>
>> Pick the one you prefer so we don't rat hole down the naming abyss :-)
>>
>> Pavel, your point about the overload with j.u.stream.Stream is a reasonable one (I am not too concerned by it myself). I hope one day in the future we can have Stream<int> :-)
>>
>> Paul.
>
> Patrick
More information about the core-libs-dev
mailing list