RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v3]

Vladimir Sitnikov vsitnikov at openjdk.org
Mon Dec 4 14:07:43 UTC 2023


On Mon, 4 Dec 2023 13:58:45 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>The backing array is not frozen so a read-only view doesn't address the second part of the concern where the target keeps a reference.

The users outside of OpenJDK would not have a reference to `byte[]`.
Do you mean a reference to `ByteBuffer`?
What if there was a `ByteBuffer#forbidReads()` method that would permanently forbid subsequent reads from the `ByteBuffer`?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1413921224


More information about the core-libs-dev mailing list