java.nio.channels

Interface ReadableByteChannel

public interface ReadableByteChannel extends Channel

Method Summary
intread(ByteBuffer dst)
Reads a sequence of bytes from this channel into the given buffer

Method Detail

read

public int read(ByteBuffer dst)
Reads a sequence of bytes from this channel into the given buffer

Parameters: dst the buffer to put the read data into

Returns: the numer of bytes read

Throws: AsynchronousCloseException If another thread closes this channel while the read operation is in progress ClosedByInterruptException 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 status ClosedChannelException If this channel is closed IOException If an error occurs NonReadableChannelException If this channel was not opened for reading