RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v18]
Alan Bateman
alanb at openjdk.org
Sat Dec 30 12:07:59 UTC 2023
On Thu, 28 Dec 2023 15:09:09 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: Fix test
src/java.base/share/classes/java/io/BufferedInputStream.java line 672:
> 670: * <li>does not modify the contents of the {@code byte[]}</li>
> 671: * <li>{@code OutputStream.write(byte[], int, int)} write does not read the contents outside of the offset/length bounds</li>
> 672: * </ul>
The implementation change looks fine, just a typo at L671 where it says "write write", I think you can shorten this to say that the write method doesn't read the contents outside of the offset/length bounds.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1438575672
More information about the core-libs-dev
mailing list