Reads are synchronous on a ReadableByteChannel, that is, if a read is already in progress on the channel then subsequent reads will block until the first read completes. It is undefined whether non-read operations will block.
| Method Summary | |
|---|---|
| int |
Reads bytes from the channel into the given buffer. |
The maximum number of bytes that will be read is the
remaining()number of bytes in the buffer when the method invoked. The bytes will be read into the buffer starting at the buffer'sposition.The call may block if other threads are also attempting to read on the same channel.
Upon completion, the buffer's
position()is updated to the end of the bytes that were read. The buffer'slimit()is unmodified.