InputStream wrapper that limits the number of bytes that can be read form the underlying InputStream.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the number of bytes available.Overrides java. Returns the number of bytes not yet consumed. |
| public void | close()
Overrides java. Implements java. Closes this stream and throws away any bytes not consumed from the underlying |
| protected long | Returns: the number of bytes skipped.Skips the number bytes not yet consumed from the underlying |
| private void | |
| public int | |
| public int | read(byte[]
the buffer into which the data is read. b)Overrides java. Forwards the read to |
| public int | read(byte[]
the buffer into which the data is read. b, int the start offset in array off, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. Reads bytes from the underlying |
| public int | Returns: the number of bytes not consumed before reseting the limit.the new length to set. len)Resets this |
| closed | back to summary |
|---|---|
| private boolean closed | |
| consumed | back to summary |
|---|---|
| private int consumed | |
| limit | back to summary |
|---|---|
| private int limit | |
| ConfinedInputStream | back to summary |
|---|---|
| protected ConfinedInputStream(InputStream in) | |
| ConfinedInputStream | back to summary |
|---|---|
| protected ConfinedInputStream(InputStream in, int lim) | |
| available | back to summary |
|---|---|
| public int available() throws IOException Overrides java. Returns the number of bytes not yet consumed. Note that this method doen't care about the exact number of bytes that may or may not be available in the
underlying
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Closes this stream and throws away any bytes not consumed from the underlying
| |
| dumpLeftovers | back to summary |
|---|---|
| protected long dumpLeftovers() throws IOException Skips the number bytes not yet consumed from the underlying
| |
| ensureOpen | back to summary |
|---|---|
| private void ensureOpen() throws IOException Ensures that this
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(byte[] b) throws IOException Overrides java. Forwards the read to
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) throws IOException Overrides java. Reads bytes from the underlying
| |
| resetLimit | back to summary |
|---|---|
| public int resetLimit(int len) Resets this
| |