java.nio.channels
Interface ReadableByteChannel

All Superinterfaces:
Channel, Closeable
All Known Subinterfaces:
ByteChannel, ScatteringByteChannel
All Known Implementing Classes:
DatagramChannel, FileChannel, Pipe.SourceChannel, SocketChannel

public interface ReadableByteChannel
extends Channel


Method Summary
 int read(ByteBuffer dst)
          Reads a sequence of bytes from this channel into the given buffer
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 

Method Detail

read

int read(ByteBuffer dst)
         throws IOException
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