Class ZipFile.BoundedFileChannelInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.compress.utils.BoundedArchiveInputStream
org.apache.commons.compress.archivers.zip.ZipFile.BoundedFileChannelInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- ZipFile
Lock-free implementation of BoundedInputStream. The implementation uses positioned reads on the underlying archive file channel and therefore performs
significantly faster in concurrent environment.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBoundedFileChannelInputStream
(long start, long remaining, FileChannel archive) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
read
(long pos, ByteBuffer buf) Read content of the stream into aByteBuffer
.Methods inherited from class org.apache.commons.compress.utils.BoundedArchiveInputStream
read, read
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, reset, skip
-
Field Details
-
archive
-
-
Constructor Details
-
BoundedFileChannelInputStream
BoundedFileChannelInputStream(long start, long remaining, FileChannel archive)
-
-
Method Details
-
read
Description copied from class:BoundedArchiveInputStream
Read content of the stream into aByteBuffer
.- Specified by:
read
in classBoundedArchiveInputStream
- Parameters:
pos
- position to start the read.buf
- buffer to add the read content.- Returns:
- number of read bytes.
- Throws:
IOException
- if I/O fails.
-