RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v18]
Markus KARG
duke at openjdk.org
Sat Dec 30 17:39:55 UTC 2023
On Sat, 30 Dec 2023 16:44:14 GMT, Sergey Tsypanov <stsypanov at openjdk.org> wrote:
>> 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.
>
> Done. Can we somehow modify the test to make it white-box one? Maybe it's possible to measure memory allocation before and after method invocation in the way that we could use the difference as a proof of non-allocating invocation for trusted OutputStreams?
I assume you mean "to make it a blackbox"? Actually I do not see how we could do that *reliably*, as I already wrote recently.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1438665222
More information about the core-libs-dev
mailing list