On Mon, 4 Dec 2023 13:30:02 GMT, Vladimir Sitnikov <vsitni...@openjdk.org> wrote:
> > it doesn't solve the second part of the concern which is read-only view on > > the internal buffer. > > I think `ByteBuffer.asReadOnlyBuffer()` should resolve the issues regarding > naked byte access. At least `ByteBuffer#array()` returns `null` for read-only > buffers, and `ByteBuffer#hasArray()` returns `false`. Am I missing something? 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. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1413912622