net.i2p.client.streaming
Class MessageChannel
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
net.i2p.client.streaming.MessageChannel
- All Implemented Interfaces:
- Closeable, Channel, InterruptibleChannel, ReadableByteChannel, WritableByteChannel
public class MessageChannel
- extends SelectableChannel
- implements ReadableByteChannel, WritableByteChannel
As this does not (yet) extend SocketChannel it cannot be returned by StandardSocket.getChannel(),
until we implement an I2P SocketAddress class.
Warning, this interface and implementation is preliminary and subject to change without notice.
- Since:
- 0.8.9
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageChannel
MessageChannel(I2PSocket socket)
provider
public SelectorProvider provider()
- Specified by:
provider
in class SelectableChannel
validOps
public int validOps()
- Specified by:
validOps
in class SelectableChannel
isRegistered
public boolean isRegistered()
- Specified by:
isRegistered
in class SelectableChannel
keyFor
public SelectionKey keyFor(Selector arg0)
- Specified by:
keyFor
in class SelectableChannel
register
public SelectionKey register(Selector sel,
int ops,
Object lock)
throws ClosedChannelException
- Specified by:
register
in class SelectableChannel
- Throws:
ClosedChannelException
configureBlocking
public SelectableChannel configureBlocking(boolean blocking)
throws IOException
- Specified by:
configureBlocking
in class SelectableChannel
- Throws:
IOException
isBlocking
public boolean isBlocking()
- Specified by:
isBlocking
in class SelectableChannel
blockingLock
public Object blockingLock()
- Specified by:
blockingLock
in class SelectableChannel
implCloseChannel
protected void implCloseChannel()
throws IOException
- Specified by:
implCloseChannel
in class AbstractInterruptibleChannel
- Throws:
IOException
read
public int read(ByteBuffer buf)
throws IOException
- Specified by:
read
in interface ReadableByteChannel
- Throws:
IOException
write
public int write(ByteBuffer buf)
throws IOException
- Specified by:
write
in interface WritableByteChannel
- Throws:
IOException