RFR JDK-8066867: Add InputStream transferTo to transfer content to an OutputStream

Chris Hegarty chris.hegarty at oracle.com
Tue Dec 9 16:26:09 UTC 2014


On 9 Dec 2014, at 16:17, David M. Lloyd <david.lloyd at redhat.com> wrote:

> On 12/09/2014 09:47 AM, Pavel Rappo wrote:
>> Hi everyone,
>> 
>> Could you please review my change for JDK-8066867?
>> 
>> http://cr.openjdk.java.net/~prappo/8066867/webrev.00/
> 
> In the NIO version of this method, it accepts a 'long' parameter which indicates how many bytes should be transferred (similar to skip()).  Is there a reason not to do that here as well?

This primary purpose of this method is to replace the boilerplate loop to read to EOF. There was a lengthly thread on this mailing list over the past week, or so, and the consensus has brought us to this API. My preference is to keep the API simple, and I think it covers intended use case.

-Chris. 


More information about the core-libs-dev mailing list