Class ZipArchiveInputStream.BoundedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.BoundedInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
ZipArchiveInputStream
Bounded input stream adapted from commons-io
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longthe max length to provideprivate longthe number of bytes already returnedFields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionBoundedInputStream(InputStream in, long size) Creates a newBoundedInputStreamthat wraps the given input stream and limits it to a certain size. -
Method Summary
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, reset
-
Field Details
-
max
private final long maxthe max length to provide -
pos
private long posthe number of bytes already returned
-
-
Constructor Details
-
BoundedInputStream
Creates a newBoundedInputStreamthat wraps the given input stream and limits it to a certain size.- Parameters:
in- The wrapped input streamsize- The maximum number of bytes to return
-
-
Method Details
-
available
- Overrides:
availablein classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-