8276779: (ch) InputStream returned by Channels.newInputStream should have fast path for SelectableChannels

Reviewed-by: lancea, alanb
This commit is contained in:
Markus Karg 2021-12-04 09:27:23 +00:00 committed by Alan Bateman
parent 02ee337ae0
commit 9642629d15
3 changed files with 110 additions and 11 deletions

View file

@ -69,9 +69,12 @@ public final class Channels {
/**
* Constructs a stream that reads bytes from the given channel.
*
* <p> The {@code read} methods of the resulting stream will throw an
* {@link IllegalBlockingModeException} if invoked while the underlying
* channel is in non-blocking mode. The stream will not be buffered, and
* <p> The {@code read} and {@code transferTo} methods of the resulting stream
* will throw an {@link IllegalBlockingModeException} if invoked while the
* underlying channel is in non-blocking mode. The {@code transferTo} method
* will also throw an {@code IllegalBlockingModeException} if invoked to
* transfer bytes to an output stream that writes to an underlying channel in
* non-blocking mode. The stream will not be buffered, and
* it will not support the {@link InputStream#mark mark} or {@link
* InputStream#reset reset} methods. The stream will be safe for access by
* multiple concurrent threads. Closing the stream will in turn cause the