Module kala.compress.archivers.zip
Package kala.compress.archivers.zip
Class ZipArchiveReader.BoundedFileChannelInputStream
java.lang.Object
java.io.InputStream
kala.compress.utils.BoundedArchiveInputStream
kala.compress.archivers.zip.ZipArchiveReader.BoundedFileChannelInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
ZipArchiveReader
private static class ZipArchiveReader.BoundedFileChannelInputStream
extends BoundedArchiveInputStream
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 intread(long pos, ByteBuffer buf) Reads content of the stream into aByteBuffer.Methods inherited from class kala.compress.utils.BoundedArchiveInputStream
read, readMethods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
archive
-
-
Constructor Details
-
BoundedFileChannelInputStream
BoundedFileChannelInputStream(long start, long remaining, FileChannel archive)
-
-
Method Details
-
read
Description copied from class:BoundedArchiveInputStreamReads content of the stream into aByteBuffer.- Specified by:
readin 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.
-