RFR [9] 8139706: JarFile.getBytes could use InputStream.readNBytes (original) (raw)
Claes Redestad claes.redestad at oracle.com
Fri Oct 16 22:20:30 UTC 2015
- Previous message: RFR [9] 8139706: JarFile.getBytes could use InputStream.readNBytes
- Next message: RFR [9] 8139706: JarFile.getBytes could use InputStream.readNBytes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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:
http://cr.openjdk.java.net/~redestad/8139706/webrev.04
/Claes
- Previous message: RFR [9] 8139706: JarFile.getBytes could use InputStream.readNBytes
- Next message: RFR [9] 8139706: JarFile.getBytes could use InputStream.readNBytes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]