RFR 8193842: Refactor InputStream-to-OutputStream copy into a utility method

Brian Burkhalter brian.burkhalter at oracle.com
Thu Jan 4 17:18:47 UTC 2018

On Jan 4, 2018, at 12:06 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

>>>>> So not clear to me that Files.copy methods needs to use this.
>>>> So you are suggesting leaving the call to InputStream.transferTo() in preference to IOSupport.copy()?
>>> Yes, I think these two should use transferTo.
>> I don’t think that transferTo() can be used in JrtPath right now as BUILD_JRTFS sets the compiler option “—release 8” and transferTo() was added in 9. So unless this can be changed to 9, then JrtPath would need either to remain unchanged or use IOSupport.copy().
> Sorry, when I said "these two should use transferTo" then I meant the Files.copy(Path, OutputStream) and Files.copy(InputStream, Path) methods, not the jrtfs code. You are right that jrtfs is complicated as it is compiled and packaged into jrtfs.jar for use by tools running on JDK 8. You'll have to leave that as is (it can't use IOSupport.copy or any other internal API).

Patch updated per this e-mail thread:




More information about the core-libs-dev mailing list