Class ZipArchiveInputStream.BoundedInputStream
java.lang.Object
java.io.InputStream
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 InputStream
the wrapped input streamprivate final long
the max length to provideprivate long
the number of bytes already returned -
Constructor Summary
ConstructorsConstructorDescriptionBoundedInputStream
(InputStream in, long size) Creates a newBoundedInputStream
that wraps the given input stream and limits it to a certain size. -
Method Summary
Methods inherited from class java.io.InputStream
close, mark, markSupported, readAllBytes, readNBytes, reset, transferTo
-
Field Details
-
in
the wrapped input stream -
max
private final long maxthe max length to provide -
pos
private long posthe number of bytes already returned
-
-
Constructor Details
-
BoundedInputStream
Creates a newBoundedInputStream
that 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
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-