-
Type:
Sub-task
-
Resolution: Delivered
-
Priority:
P4
-
Affects Version/s: 18
-
Component/s: core-libs
-
generic
-
generic
-
Verified
`ReadableByteChannel::read` no longer incorrectly throws `ReadOnlyBufferException`.
The `read(ByteBuffer)` method of the `ReadableByteChannel` returned by `java.nio.channels.Channel.newChannel(InputStream)` was incorrectly throwing `ReadOnlyBufferException` when its `ByteBuffer` parameter specified a read-only buffer. `ReadableByteChannel::read` is, however, specified in this case to throw an `IllegalArgumentException`. The implementation has been changed for this case to throw an `IllegalArgumentException` instead of a `ReadOnlyBufferException`, as dictated by the specification.
The `read(ByteBuffer)` method of the `ReadableByteChannel` returned by `java.nio.channels.Channel.newChannel(InputStream)` was incorrectly throwing `ReadOnlyBufferException` when its `ByteBuffer` parameter specified a read-only buffer. `ReadableByteChannel::read` is, however, specified in this case to throw an `IllegalArgumentException`. The implementation has been changed for this case to throw an `IllegalArgumentException` instead of a `ReadOnlyBufferException`, as dictated by the specification.