RFR: 8316391: (zipfs) ZipFileSystem.readFullyAt does not tolerate short reads
Lance Andersen
lancea at openjdk.org
Sun Sep 17 11:03:39 UTC 2023
On Sat, 16 Sep 2023 09:07:09 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> 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.
>
> Testing: tier1-tier4
Marked as reviewed by lancea (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/15772#pullrequestreview-1630068892
More information about the nio-dev
mailing list