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

Alan Bateman alanb at openjdk.org
Sun Sep 17 11:55:48 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

This pull request has now been integrated.

Changeset: f4403296
Author:    Alan Bateman <alanb at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/f44032969f37948a49e5bd0ed6738aa4d93687da
Stats:     56 lines in 3 files changed: 18 ins; 1 del; 37 mod

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

Reviewed-by: jpai, lancea

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

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


More information about the nio-dev mailing list