On Thu, 12 Aug 2021 01:16:04 GMT, Brian Burkhalter <b...@openjdk.org> wrote:

> Please consider this request to add an override 
> `java.io.FileInputStream.transferTo(OutputStream)` with improved performance 
> if the parameter is a `FileOutputStream`.

Changes requested by alanb (Reviewer).

src/java.base/share/classes/java/io/FileInputStream.java line 371:

> 369:                 // not, then use the superclass method to copy those 
> remaining
> 370:                 if (fci.transferTo(pos, count, fco) == count) {
> 371:                     return count;

Are you sure this is right? FileChannel transferTo doesn't modify the source 
channel's position so I assume the method above will finish with the 
InputStream at its initial position rather than EOF. How are we on test 
coverage for this case?

-------------

PR: https://git.openjdk.java.net/jdk/pull/5097

Reply via email to