Integrated: 8325382: (fc) FileChannel.transferTo throws IOException when position equals size

Brian Burkhalter bpb at openjdk.org
Tue Feb 13 15:56:08 UTC 2024


On Fri, 9 Feb 2024 19:55:15 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> In `FileChannelImpl.transferTo`, do not clamp the number of bytes to transfer to the number remaining in the source `FileChannel` unless the size of the source is positive. When clamping, do not use the strict inequality `remaining > 0`, but rather allow clamping to zero.

This pull request has now been integrated.

Changeset: 6b7c9718
Author:    Brian Burkhalter <bpb at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/6b7c9718d68f30f47a163042d6e205945b9ff365
Stats:     50 lines in 2 files changed: 36 ins; 9 del; 5 mod

8325382: (fc) FileChannel.transferTo throws IOException when position equals size

Reviewed-by: alanb

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

PR: https://git.openjdk.org/jdk/pull/17796


More information about the nio-dev mailing list