org.restlet.engine.io
Class ReadableChunkingChannel

java.lang.Object
  extended by org.restlet.engine.io.WrapperChannel<ReadableByteChannel>
      extended by org.restlet.engine.io.ReadableChunkingChannel
All Implemented Interfaces:
Closeable, Channel, ReadableByteChannel

public class ReadableChunkingChannel
extends WrapperChannel<ReadableByteChannel>
implements ReadableByteChannel

Readable byte channel capable of encoding chunked entities.


Constructor Summary
ReadableChunkingChannel(ReadableByteChannel source, int maxBufferSize)
          Constructor.
 
Method Summary
 int read(ByteBuffer dst)
          Reads some bytes and put them into the destination buffer.
 
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

ReadableChunkingChannel

public ReadableChunkingChannel(ReadableByteChannel source,
                               int maxBufferSize)
Constructor.

Parameters:
source - The source channel.
maxBufferSize - The total available size that can be read from the source channel.
Method Detail

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


Copyright © 2005-2013 Restlet.