RFR: 8275149: (ch) ReadableByteChannel returned by Channels.newChannel(InputStream) throws ReadOnlyBufferException

Alan Bateman alanb at openjdk.java.net
Tue Oct 12 18:18:53 UTC 2021


On Tue, 12 Oct 2021 17:56:59 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> This small change would modify `java.nio.channels.Channels$ReadableByteChannelImpl.read(ByteBuffer)` to throw an `IllegalArgumentException` if the `ByteBuffer` parameter is read-only as required by its specification instead of the `ReadOnlyBufferException` currently thrown.

Looks okay but it is a behavior change. We should check if there is anything dependent on the existing exception. We'll need a RN, maybe a CSR.

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

Marked as reviewed by alanb (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5914


More information about the nio-dev mailing list