-
Bug
-
Resolution: Fixed
-
P4
-
18
-
b20
-
generic
-
generic
-
Verified
Such a ReadableByteChannel should throw an IllegalArgumentException. This may be demonstrated by modifying java/nio/channels/Channels/Basic.java as:
@@ -296,6 +296,12 @@ public class Basic {
byte data[] = new byte[messageSize+1];
ByteBuffer bb = ByteBuffer.wrap(data);
+ try {
+ rbc.read(bb.asReadOnlyBuffer());
+ } catch (IllegalArgumentException expected) {
+ // ignore it
+ }
+
int bytesRead = 0;
int totalRead = 0;
while (bytesRead != -1) {
@@ -296,6 +296,12 @@ public class Basic {
byte data[] = new byte[messageSize+1];
ByteBuffer bb = ByteBuffer.wrap(data);
+ try {
+ rbc.read(bb.asReadOnlyBuffer());
+ } catch (IllegalArgumentException expected) {
+ // ignore it
+ }
+
int bytesRead = 0;
int totalRead = 0;
while (bytesRead != -1) {
- csr for
-
JDK-8275183 (ch) ReadableByteChannel returned by Channels.newChannel(InputStream) throws ReadOnlyBufferException
- Closed