RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]
Markus KARG
duke at openjdk.org
Sat Dec 16 17:54:43 UTC 2023
On Thu, 14 Dec 2023 08:47:03 GMT, Sergey Tsypanov <stsypanov at openjdk.org> wrote:
>> It looks like we can skip copying of `byte[]` in `BufferedInputStream.implTransferTo()` for `OutputStreams` residing in `java.io`.
>>
>> See comment by @vlsi in https://github.com/openjdk/jdk/pull/10525/files#diff-e19c508d1bb6ee78697ecca66947c395adda0d9c49a85bf696e677ecbd977af1R612
>
> Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:
>
> 8320971: Revert irrelevant changes
I know it is a bit disappointing to undo the nice changes you did just days ago, but to get this PR merged quickly it is best to follow Alan's proposal.
src/java.base/share/classes/java/io/BufferedInputStream.java line 677:
> 675: * @see java.io.BufferedInputStream#implTransferTo(OutputStream)
> 676: */
> 677: private static boolean isTrusted(OutputStream os) {
Let's follow Alan's proposal and simply inline this. The solution is in sync with BAIS then, and we can merge it quickly.
test/jdk/java/io/BufferedInputStream/TransferToTrusted.java line 85:
> 83: }
> 84:
> 85: private static void byteArrayOutputStream(BufferedInputStream bis, byte[] buf) throws IOException {
As we agreed that this PR shall only cover BIS, we can remove the additional classes' tests again.
-------------
Changes requested by mkarg at github.com (no known OpenJDK username).
PR Review: https://git.openjdk.org/jdk/pull/16879#pullrequestreview-1785245773
PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1428872958
PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1428873231
More information about the core-libs-dev
mailing list