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

Alan Bateman Alan.Bateman at oracle.com
Thu Jan 4 08:06:38 UTC 2018

On 04/01/2018 01:48, Brian Burkhalter wrote:
> On Jan 3, 2018, at 3:23 AM, Alan Bateman <Alan.Bateman at oracle.com 
> <mailto:Alan.Bateman at oracle.com>> wrote:
>> On 02/01/2018 23:43, Brian Burkhalter 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).


More information about the core-libs-dev mailing list