FileDocCategorySizeDatePackage
Channel.javaAPI DocAndroid 1.5 API2504Wed May 06 22:41:04 BST 2009java.nio.channels

Channel

public interface Channel implements Closeable
A channel is a conduit to I/O services covering such items as files, sockets, hardware devices, I/O ports or some software component.

Channels are open upon creation, and can be closed explicitly. Once a channel is closed it cannot be re-opened, and any attempts to perform I/O operations on the closed channel result in a ClosedChannelException.

Particular implementations or sub-interfaces of {@code Channel} dictate whether they are thread-safe or not.

since
Android 1.0

Fields Summary
Constructors Summary
Methods Summary
public voidclose()
Closes an open channel. If the channel is already closed then this method has no effect. If there is a problem with closing the channel then the method throws an IOException and the exception contains reasons for the failure.

If an attempt is made to perform an operation on a closed channel then a {@link ClosedChannelException} will be thrown on that attempt.

If multiple threads attempt to simultaneously close a channel, then only one thread will run the closure code, and others will be blocked until the first returns.

throws
IOException if a problem occurs closing the channel.
since
Android 1.0

public booleanisOpen()
Returns whether this channel is open or not.

return
true if the channel is open, otherwise returns false.
since
Android 1.0