| Modifier and Type | Field and Description |
|---|---|
| private boolean | closed
Whether this stream is already closed. |
| private long | count
The current number of bytes. |
| private final long | sizeMax
The maximum size of an item, in bytes. |
| Access | Constructor and Description |
|---|---|
| public | LimitedInputStream(final InputStream
The input stream, which shall be limited. inputStream, final long The limit; no more than this number of bytes
shall be returned by the source stream. pSizeMax)Creates a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | close()
Overrides java. Implements org. Closes this input stream and releases any system resources associated with the stream. |
| public boolean | Returns: True, if the stream is closed, otherwise false.Implements org. Returns, whether this stream is already closed. |
| protected abstract void | raiseError(long
The input streams limit, in bytes. pSizeMax, long The actual number of bytes. pCount)Called to indicate, that the input streams limit has been exceeded. |
| public int | Returns: the next byte of data, or-1 if the end of the
stream is reached.Overrides java. Reads the next byte of data from this input stream. |
| public int | Returns: the total number of bytes read into the buffer, or-1 if there is no more data because the end of
the stream has been reached.the buffer into which the data is read. b, final int The start offset in the destination array
off, final int b.the maximum number of bytes read. len)Overrides java. Reads up to |
| closed | back to summary |
|---|---|
| private boolean closed Whether this stream is already closed. | |
| count | back to summary |
|---|---|
| private long count The current number of bytes. | |
| sizeMax | back to summary |
|---|---|
| private final long sizeMax The maximum size of an item, in bytes. | |
| LimitedInputStream | back to summary |
|---|---|
| public LimitedInputStream(final InputStream inputStream, final long pSizeMax) Creates a new instance.
| |
| checkLimit | back to summary |
|---|---|
| private void checkLimit() throws IOException Called to check, whether the input streams limit is reached.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements org. Closes this input stream and releases any system resources
associated with the stream.
This
method simply performs
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() throws IOException Implements org. Returns, whether this stream is already closed.
| |
| raiseError | back to summary |
|---|---|
| protected abstract void raiseError(long pSizeMax, long pCount) throws IOException Called to indicate, that the input streams limit has been exceeded.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Reads the next byte of data from this input stream. The value
byte is returned as an
This method
simply performs
| |
| read | back to summary |
|---|---|
| public int read(final byte[] b, final int off, final int len) throws IOException Overrides java. Reads up to
This method simply performs
| |