org.restlet.engine.http.io

## Class InputEntityStream

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

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

Direct Known Subclasses:
  ChunkedInputStream, ClosingInputStream, SizedInputStream

    public abstract class InputEntityStream
    extends java.io.InputStream

Input stream that synchronizes the state of a `Connection` instance and an input stream.

### Constructor Summary

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

### Method Summary

Methods
`protected java.io.InputStream` `getInboundStream()` Returns the inbound stream.
`protected void` `onEndReached()` To be called when the end of the stream is reached.
`protected void` `onError()` To be called when there is an error when handling the stream.

### Methods inherited from class java.io.InputStream

`available, close, mark, markSupported, read, read, read, reset, skip`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### InputEntityStream

    public InputEntityStream(Notifiable notifiable,
                     java.io.InputStream inboundStream)

Constructor.

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

### Method Detail

#### getInboundStream

    protected java.io.InputStream getInboundStream()

Returns the inbound stream.

Returns:
  The inbound stream.

#### onEndReached

    protected void onEndReached()

To be called when the end of the stream is reached. By default, it updates the state of the connection ( `Connection.setInboundBusy(boolean)`) .

#### onError

    protected void onError()

To be called when there is an error when handling the stream. By default it calls `onEndReached()` and set the state of the connection to `ConnectionState.CLOSING` in order to release this stream.