Name
Channel
Synopsis
This
interface defines a communication
channel for input and output. The Channel
interface is a high-level generic interface which is extended by more
specific interfaces, such as ReadableByteChannel
and WritableByteChannel.
Channel defines only two methods: isOpen(
)
determines whether a channel is open, and close( )
closes a channel. Channels are open when they are first created. Once
closed, a channel remains closed forever, and no further I/O
operations may take place through it.
Many channel implementations are interruptible and asynchonously
closeable, and implement the InterruptibleChannel
interface to advertise this fact. See
InterruptibleChannel for details.
Figure 13-17. java.nio.channels.Channel
public interface Channel extends java.io.Closeable { // Public Instance Methods void close( ) throws java.io.IOException; boolean isOpen( ); }
Implementations
InterruptibleChannel,
ReadableByteChannel,
SelectableChannel,
WritableByteChannel,
java.nio.channels.spi.AbstractInterruptibleChannel
Returned By
System.inheritedChannel( ),
java.nio.channels.spi.SelectorProvider.inheritedChannel(
)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access