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

Jaikiran Pai jpai at openjdk.org
Sun Sep 17 06:34:50 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.

The changes look good to me.

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

Marked as reviewed by jpai (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15772#pullrequestreview-1630045421


More information about the nio-dev mailing list