RFR: 8316391: (zipfs) ZipFileSystem.readFullyAt does not tolerate short reads

Alan Bateman alanb at openjdk.org
Sat Sep 16 15:02:08 UTC 2023


While looking at another issue, ZipFileSystem.readFullyAt jumped out as not working when the underlying read returns less bytes than expected. There is never a guarantee that reading from a channel will return the expected number of bytes so readFullyAt needs to loop if there is a short read. I've renamed the method as it's really a positional-readNBytes. Test LargeGatheringWrite.java has the same issue so fixed it while in the area.

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

Commit messages:
 - LargeGatheringWrite test has same issue
 - Initial commit

Changes: https://git.openjdk.org/jdk/pull/15772/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15772&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8316391
  Stats: 56 lines in 3 files changed: 18 ins; 1 del; 37 mod
  Patch: https://git.openjdk.org/jdk/pull/15772.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15772/head:pull/15772

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


More information about the nio-dev mailing list