private class ZipArchiveInputStream.BoundedInputStream
extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
private java.io.InputStream |
in
the wrapped input stream
|
private long |
max
the max length to provide
|
private long |
pos
the number of bytes already returned
|
Constructor and Description |
---|
BoundedInputStream(java.io.InputStream in,
long size)
Creates a new
BoundedInputStream that wraps the given input
stream and limits it to a certain size. |
Modifier and Type | Method and Description |
---|---|
int |
available() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
private final java.io.InputStream in
private final long max
private long pos
public BoundedInputStream(java.io.InputStream in, long size)
BoundedInputStream
that wraps the given input
stream and limits it to a certain size.in
- The wrapped input streamsize
- The maximum number of bytes to returnpublic int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException