RFR: 8374382: (aio) AsynchronousFileChannel writes wrong content using heap ByteBuffer when position != 0

Alan Bateman alanb at openjdk.org
Wed Dec 31 07:48:33 UTC 2025


On Windows only, if AsynchronousFileChannel is used with a heap ByteBuffer with a non-0 buffer position then the AsynchronousFileChannel read/write methods don't work correctly when the buffer is "substituted" for the underlying I/O operation.

This is a regression in JDK 26 after JDK-8357847, missed as we didn't have tests that exercise this scenario.

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

Commit messages:
 - Remove unused import
 - Fix test summary
 - Initial commit

Changes: https://git.openjdk.org/jdk/pull/29010/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29010&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8374382
  Stats: 191 lines in 2 files changed: 189 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/29010.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29010/head:pull/29010

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


More information about the nio-dev mailing list