|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.engine.io.WrapperChannel<ReadableByteChannel>
org.restlet.engine.io.ReadableSizedChannel
public class ReadableSizedChannel
Readable byte channel enforcing a maximum size.
| Constructor Summary | |
|---|---|
ReadableSizedChannel(ReadableByteChannel source,
long availableSize)
Constructor. |
|
| Method Summary | |
|---|---|
protected long |
getAvailableSize()
Returns the remaining size that should be read from the source channel. |
protected boolean |
isEndDetected()
Indicates if the end of the channel has been detected. |
int |
read(ByteBuffer dst)
Reads some bytes and put them into the destination buffer. |
protected void |
setAvailableSize(long availableSize)
Sets the remaining size that should be read from the source channel. |
protected void |
setEndDetected(boolean endDetected)
Indicates if the end of the channel has been detected. |
| Methods inherited from class org.restlet.engine.io.WrapperChannel |
|---|
close, getWrappedChannel, isOpen |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.nio.channels.Channel |
|---|
close, isOpen |
| Constructor Detail |
|---|
public ReadableSizedChannel(ReadableByteChannel source,
long availableSize)
source - The source channel.availableSize - The total available size that can be read from the source
channel.| Method Detail |
|---|
protected long getAvailableSize()
protected boolean isEndDetected()
public int read(ByteBuffer dst)
throws IOException
read in interface ReadableByteChanneldst - The destination buffer.
IOExceptionprotected void setAvailableSize(long availableSize)
availableSize - The remaining size that should be read from the source
channel.
protected void setEndDetected(boolean endDetected)
throws IOException
endDetected - True if the end of the channel has been detected.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||