org.restlet.engine.http.io
Class ReadableEntityChannel
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
org.restlet.engine.http.io.ReadableEntityChannel
- All Implemented Interfaces:
- Closeable, Channel, InterruptibleChannel, ReadableByteChannel
public class ReadableEntityChannel
- extends SelectableChannel
- implements ReadableByteChannel
Readable byte channel based on a source socket channel that must only be
partially read.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReadableEntityChannel
public ReadableEntityChannel(ByteBuffer remainingBuffer,
SelectableChannel source,
long availableSize)
- Constructor.
- Parameters:
remainingBuffer
- The byte buffer remaining from previous read processing.source
- The source channel.availableSize
- The available size that can be read from the source channel.
blockingLock
public Object blockingLock()
- Specified by:
blockingLock
in class SelectableChannel
configureBlocking
public SelectableChannel configureBlocking(boolean block)
throws IOException
- Specified by:
configureBlocking
in class SelectableChannel
- Throws:
IOException
implCloseChannel
protected void implCloseChannel()
throws IOException
- Specified by:
implCloseChannel
in class AbstractInterruptibleChannel
- Throws:
IOException
isBlocking
public boolean isBlocking()
- Specified by:
isBlocking
in class SelectableChannel
isRegistered
public boolean isRegistered()
- Specified by:
isRegistered
in class SelectableChannel
keyFor
public SelectionKey keyFor(Selector sel)
- Specified by:
keyFor
in class SelectableChannel
provider
public SelectorProvider provider()
- Specified by:
provider
in class SelectableChannel
read
public int read(ByteBuffer dst)
throws IOException
- Reads some bytes and put them into the destination buffer. The bytes come
from the underlying channel.
- Specified by:
read
in interface ReadableByteChannel
- Parameters:
dst
- The destination buffer.
- Returns:
- The number of bytes read, or -1 if the end of the channel has
been reached.
- Throws:
IOException
register
public SelectionKey register(Selector sel,
int ops,
Object att)
throws ClosedChannelException
- Specified by:
register
in class SelectableChannel
- Throws:
ClosedChannelException
validOps
public int validOps()
- Specified by:
validOps
in class SelectableChannel
Copyright © 2005-2011 Noelios Technologies.