Save This Page
Home » apache-harmony-6.0-src-r917296-snapshot » java » nio » channels » [javadoc | source]
java.nio.channels
public interface: ScatteringByteChannel [javadoc | source]

All Implemented Interfaces:
    ReadableByteChannel

All Known Implementing Classes:
    SourceChannel, FileChannel, SocketChannel, DatagramChannel

The interface for channels that can read data into a set of buffers in a single operation. The corresponding interface for writes is GatheringByteChannel .
Method from java.nio.channels.ScatteringByteChannel Summary:
read,   read
Method from java.nio.channels.ScatteringByteChannel Detail:
 public long read(ByteBuffer[] buffers) throws IOException
    Reads bytes from this channel into the specified array of buffers.

    This method is equivalent to {@code read(buffers, 0, buffers.length);}

 public long read(ByteBuffer[] buffers,
    int offset,
    int length) throws IOException
    Attempts to read all {@code remaining()} bytes from {@code length} byte buffers, in order, starting at {@code buffers[offset]}. The number of bytes actually read is returned.

    If a read operation is in progress, subsequent threads will block until the read is completed and will then contend for the ability to read.