RFR: 8274112: (fc) Tune FileChannel.transferTo() [v3]

Brian Burkhalter bpb at openjdk.java.net
Thu Sep 23 02:07:32 UTC 2021


On Wed, 22 Sep 2021 16:36:37 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> src/java.base/windows/native/libnio/ch/FileChannelImpl.c line 177:
>> 
>>> 175:         if (WriteFile(dst, &buf, nr, &nw, NULL) == 0) {
>>> 176:             JNU_ThrowIOExceptionWithLastError(env, "WriteFile failed");
>>> 177:             return IOS_THROWN;
>> 
>> If ReadFile or WriteFile fails then I assume we should return tw when > 0.
>
> In the macOS code if `read()` or `write()` fails then an exception is thrown. I suppose the two read-write versions should be consistent one way or the other.

This is resolved in commit three.

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

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


More information about the nio-dev mailing list