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

Brian Burkhalter bpb at openjdk.java.net
Tue Oct 12 18:06:06 UTC 2021


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.

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

Commit messages:
 - 8275149: throw RuntimeException if IAE not thrown
 - 8275149: (ch) ReadableByteChannel returned by Channels.newChannel(InputStream) throws ReadOnlyBufferException

Changes: https://git.openjdk.java.net/jdk/pull/5914/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5914&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8275149
  Stats: 12 lines in 2 files changed: 10 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5914.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5914/head:pull/5914

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


More information about the nio-dev mailing list