RFR  8139706: JarFile.getBytes could use InputStream.readNBytes
claes.redestad at oracle.com
Fri Oct 16 22:20:30 UTC 2015
On 2015-10-16 18:48, Xueming Shen wrote:
> looks fine. though it might be better to simply check len != b.length,
> as it's still possible that reallAllBytes
> returns a byte with length > len, if the entry is compressed, and
> the "length" in entry does not really
> match the length of the bytes from the inflater.
> If you go with len != b.length, you can pull two checks out and
> consolidate them at the end before return.
We'll also need to check that len != -1 in that extracted check, but I
guess it's still cleaner:
More information about the core-libs-dev