RFR: 8321053: Use ByteArrayInputStream.buf directly when parameter of transferTo() is trusted [v5]
Alan Bateman
alanb at openjdk.org
Tue Dec 5 17:37:39 UTC 2023
On Tue, 5 Dec 2023 16:40:59 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Pass `ByteArrayInputStream.buf ` directly to the `OutputStream` parameter of `BAIS.transferTo` only if the target stream is in the `java.io` package.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 8321053: Remove package check in trustworthiness verification
Marked as reviewed by alanb (Reviewer).
src/java.base/share/classes/java/io/ByteArrayInputStream.java line 218:
> 216: tmp = null;
> 217: else
> 218: tmp = new byte[Integer.min(len, MAX_TRANSFER_SIZE)];
Looks okay, I'd probably rename tmp to something better, maybe tmpbuf.
-------------
PR Review: https://git.openjdk.org/jdk/pull/16893#pullrequestreview-1765665329
PR Review Comment: https://git.openjdk.org/jdk/pull/16893#discussion_r1415998481
More information about the core-libs-dev
mailing list