RFR: 8283411: InflaterInputStream holds on to a temporary byte array of 512 bytes [v2]
Jaikiran Pai
jpai at openjdk.java.net
Tue Mar 22 04:04:25 UTC 2022
On Sun, 20 Mar 2022 14:01:50 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> src/java.base/share/classes/java/util/zip/InflaterInputStream.java line 206:
>>
>>> 204: int max = (int)Math.min(n, Integer.MAX_VALUE);
>>> 205: int total = 0;
>>> 206: byte[] b = new byte[512];
>>
>> n may be less than 512 so maybe the temporary array can be of length Math.min(max, 512).
>
> That's a good idea. I just pushed a update to this PR with this suggested change. Plus updated the copyright year too.
I ran tier1, tier2 and tier3 tests with this change and they completed successfully. Alan, does the current state of the PR look fine to you? Should I go ahead with the merge?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7875
More information about the core-libs-dev
mailing list