Skip to content

Commit b97fc93

Browse files
author
Brian Burkhalter
committed
7132279: (ch) SeekableByteChannel operation may throw Non{Readable,Writable}ChannelException
Reviewed-by: lancea, jpai
1 parent 39dda24 commit b97fc93

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/java.base/share/classes/java/nio/channels/FileChannel.java

+6-9
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ public static FileChannel open(Path path, OpenOption... options)
380380
* @throws ClosedChannelException {@inheritDoc}
381381
* @throws AsynchronousCloseException {@inheritDoc}
382382
* @throws ClosedByInterruptException {@inheritDoc}
383+
* @throws NonReadableChannelException {@inheritDoc}
383384
*/
384385
public abstract int read(ByteBuffer dst) throws IOException;
385386

@@ -395,6 +396,7 @@ public static FileChannel open(Path path, OpenOption... options)
395396
* @throws ClosedChannelException {@inheritDoc}
396397
* @throws AsynchronousCloseException {@inheritDoc}
397398
* @throws ClosedByInterruptException {@inheritDoc}
399+
* @throws NonReadableChannelException {@inheritDoc}
398400
*/
399401
public abstract long read(ByteBuffer[] dsts, int offset, int length)
400402
throws IOException;
@@ -410,6 +412,7 @@ public abstract long read(ByteBuffer[] dsts, int offset, int length)
410412
* @throws ClosedChannelException {@inheritDoc}
411413
* @throws AsynchronousCloseException {@inheritDoc}
412414
* @throws ClosedByInterruptException {@inheritDoc}
415+
* @throws NonReadableChannelException {@inheritDoc}
413416
*/
414417
public final long read(ByteBuffer[] dsts) throws IOException {
415418
return read(dsts, 0, dsts.length);
@@ -426,12 +429,10 @@ public final long read(ByteBuffer[] dsts) throws IOException {
426429
* behaves exactly as specified by the {@link WritableByteChannel}
427430
* interface. </p>
428431
*
429-
* @throws NonWritableChannelException
430-
* If this channel was not opened for writing
431-
*
432432
* @throws ClosedChannelException {@inheritDoc}
433433
* @throws AsynchronousCloseException {@inheritDoc}
434434
* @throws ClosedByInterruptException {@inheritDoc}
435+
* @throws NonWritableChannelException {@inheritDoc}
435436
*/
436437
public abstract int write(ByteBuffer src) throws IOException;
437438

@@ -447,12 +448,10 @@ public final long read(ByteBuffer[] dsts) throws IOException {
447448
* behaves exactly as specified in the {@link GatheringByteChannel}
448449
* interface. </p>
449450
*
450-
* @throws NonWritableChannelException
451-
* If this channel was not opened for writing
452-
*
453451
* @throws ClosedChannelException {@inheritDoc}
454452
* @throws AsynchronousCloseException {@inheritDoc}
455453
* @throws ClosedByInterruptException {@inheritDoc}
454+
* @throws NonWritableChannelException {@inheritDoc}
456455
*/
457456
public abstract long write(ByteBuffer[] srcs, int offset, int length)
458457
throws IOException;
@@ -468,12 +467,10 @@ public abstract long write(ByteBuffer[] srcs, int offset, int length)
468467
* behaves exactly as specified in the {@link GatheringByteChannel}
469468
* interface. </p>
470469
*
471-
* @throws NonWritableChannelException
472-
* If this channel was not opened for writing
473-
*
474470
* @throws ClosedChannelException {@inheritDoc}
475471
* @throws AsynchronousCloseException {@inheritDoc}
476472
* @throws ClosedByInterruptException {@inheritDoc}
473+
* @throws NonWritableChannelException {@inheritDoc}
477474
*/
478475
public final long write(ByteBuffer[] srcs) throws IOException {
479476
return write(srcs, 0, srcs.length);

src/java.base/share/classes/java/nio/channels/SeekableByteChannel.java

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public interface SeekableByteChannel
6464
* @throws ClosedChannelException {@inheritDoc}
6565
* @throws AsynchronousCloseException {@inheritDoc}
6666
* @throws ClosedByInterruptException {@inheritDoc}
67+
* @throws NonReadableChannelException {@inheritDoc}
6768
*/
6869
@Override
6970
int read(ByteBuffer dst) throws IOException;
@@ -83,6 +84,7 @@ public interface SeekableByteChannel
8384
* @throws ClosedChannelException {@inheritDoc}
8485
* @throws AsynchronousCloseException {@inheritDoc}
8586
* @throws ClosedByInterruptException {@inheritDoc}
87+
* @throws NonWritableChannelException {@inheritDoc}
8688
*/
8789
@Override
8890
int write(ByteBuffer src) throws IOException;

0 commit comments

Comments
 (0)