org.restlet.engine.http.io
Class ChunkedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.restlet.engine.http.io.InputEntityStream
          extended by org.restlet.engine.http.io.ChunkedInputStream
All Implemented Interfaces:
Closeable

public class ChunkedInputStream
extends InputEntityStream

InputStream to wrap a source InputStream that has been chunked. See section 3.6.1 of HTTP Protocol for more information on chunked encoding.

Author:
Kevin Conaway
See Also:
HTTP/1.1 Protocol

Constructor Summary
ChunkedInputStream(Notifiable notifiable, InputStream inboundStream)
          Constructor.
 
Method Summary
 void close()
          Closes this input stream but do not close the underlying stream.
protected  void onEndReached()
          To be called when the end of the stream is reached.
 int read()
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class org.restlet.engine.http.io.InputEntityStream
getInboundStream, onError
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkedInputStream

public ChunkedInputStream(Notifiable notifiable,
                          InputStream inboundStream)
Constructor.

Parameters:
notifiable - The notifiable connection.
inboundStream - The inbound stream.
Method Detail

close

public void close()
           throws IOException
Closes this input stream but do not close the underlying stream.

Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

onEndReached

protected void onEndReached()
Description copied from class: InputEntityStream
To be called when the end of the stream is reached. By default, it updates the state of the connection ( Connection.setInboundBusy(boolean)) .

Overrides:
onEndReached in class InputEntityStream

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException


Copyright © 2005-2011 Noelios Technologies.