Module java.base

Interface AsynchronousByteChannel

All Superinterfaces:
AsynchronousChannel, AutoCloseable, Channel, Closeable
All Known Implementing Classes:
AsynchronousSocketChannel

public interface AsynchronousByteChannel extends AsynchronousChannel
An asynchronous channel that can read and write bytes.

Some channels may not allow more than one read or write to be outstanding at any given time. If a thread invokes a read method before a previous read operation has completed then a ReadPendingException will be thrown. Similarly, if a write method is invoked before a previous write has completed then WritePendingException is thrown. Whether or not other kinds of I/O operations may proceed concurrently with a read operation depends upon the type of the channel.

Note that ByteBuffers are not safe for use by multiple concurrent threads. When a read or write operation is initiated then care must be taken to ensure that the buffer is not accessed until the operation completes.

Since:
1.7
See Also: