java.nio.channels
public interface ReadableByteChannel extends Channel
Modifier and Type | Method and Description |
---|---|
int |
read(ByteBuffer dst)
Reads a sequence of bytes from this channel into the given buffer
|
int read(ByteBuffer dst) throws IOException
dst
- the buffer to put the read data intoAsynchronousCloseException
- If another thread closes this
channel while the read operation is in progressClosedByInterruptException
- If another thread interrupts the
current thread while the read operation is in progress, thereby closing
the channel and setting the current thread's interrupt statusClosedChannelException
- If this channel is closedIOException
- If an error occursNonReadableChannelException
- If this channel was not opened for
reading