Class ReadableSizedChannel
- java.lang.Object
-
- org.restlet.ext.nio.internal.channel.WrapperChannel<java.nio.channels.ReadableByteChannel>
-
- org.restlet.ext.nio.internal.channel.ReadableSizedChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.ReadableByteChannel
@Deprecated public class ReadableSizedChannel extends WrapperChannel<java.nio.channels.ReadableByteChannel> implements java.nio.channels.ReadableByteChannel
Deprecated.Will be removed to favor lower-level network extensions allowing more control at the Restlet API level.Readable byte channel enforcing a maximum size.
-
-
Field Summary
Fields Modifier and Type Field Description private longavailableSizeDeprecated.The total available size that should be read from the source channel.private booleanendDetectedDeprecated.Indicates if the end of the wrapped channel has been reached.
-
Constructor Summary
Constructors Constructor Description ReadableSizedChannel(java.nio.channels.ReadableByteChannel source, long availableSize)Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected longgetAvailableSize()Deprecated.Returns the remaining size that should be read from the source channel.protected booleanisEndDetected()Deprecated.Indicates if the end of the channel has been detected.intread(java.nio.ByteBuffer dst)Deprecated.Reads some bytes and put them into the destination buffer.protected voidsetAvailableSize(long availableSize)Deprecated.Sets the remaining size that should be read from the source channel.protected voidsetEndDetected(boolean endDetected)Deprecated.Indicates if the end of the channel has been detected.-
Methods inherited from class org.restlet.ext.nio.internal.channel.WrapperChannel
close, getWrappedChannel, isOpen
-
-
-
-
Method Detail
-
getAvailableSize
protected long getAvailableSize()
Deprecated.Returns the remaining size that should be read from the source channel.- Returns:
- The remaining size that should be read from the source channel.
-
isEndDetected
protected boolean isEndDetected()
Deprecated.Indicates if the end of the channel has been detected.- Returns:
- True if the end of the channel has been detected.
-
read
public int read(java.nio.ByteBuffer dst) throws java.io.IOExceptionDeprecated.Reads some bytes and put them into the destination buffer. The bytes come from the underlying channel.- Specified by:
readin interfacejava.nio.channels.ReadableByteChannel- Parameters:
dst- The destination buffer.- Returns:
- The number of bytes read, or -1 if the end of the channel has been reached.
- Throws:
java.io.IOException
-
setAvailableSize
protected void setAvailableSize(long availableSize)
Deprecated.Sets the remaining size that should be read from the source channel.- Parameters:
availableSize- The remaining size that should be read from the source channel.
-
setEndDetected
protected void setEndDetected(boolean endDetected) throws java.io.IOExceptionDeprecated.Indicates if the end of the channel has been detected.- Parameters:
endDetected- True if the end of the channel has been detected.- Throws:
java.io.IOException
-
-