org.restlet.engine.http.io

## Class ChunkedInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.restlet.engine.http.io.InputEntityStream
    - - org.restlet.engine.http.io.ChunkedInputStream

All Implemented Interfaces:
  java.io.Closeable, java.lang.AutoCloseable

    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

Constructors
Constructor and Description
`ChunkedInputStream(Notifiable notifiable, java.io.InputStream inboundStream)` Constructor.

### Method Summary

Methods
`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,
                      java.io.InputStream inboundStream)

Constructor.

Parameters:
  `notifiable` - The notifiable connection.
  `inboundStream` - The inbound stream.

### Method Detail

#### close

    public void close()
               throws java.io.IOException

Closes this input stream but do not close the underlying stream.

Specified by:
  `close` in interface `java.io.Closeable`
Specified by:
  `close` in interface `java.lang.AutoCloseable`
Overrides:
  `close` in class `java.io.InputStream`
Throws:
  `java.io.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 java.io.IOException

Specified by:
  `read` in class `java.io.InputStream`
Throws:
  `java.io.IOException`

#### read

    public int read(byte[] b,
           int off,
           int len)
             throws java.io.IOException

Overrides:
  `read` in class `java.io.InputStream`
Throws:
  `java.io.IOException`