Class TarFile.BoundedTarEntryInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.compress.utils.BoundedArchiveInputStream
org.apache.commons.compress.archivers.tar.TarFile.BoundedTarEntryInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- TarFile
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SeekableByteChannel
private int
private final TarArchiveEntry
private long
-
Constructor Summary
ConstructorsConstructorDescriptionBoundedTarEntryInputStream
(TarArchiveEntry entry, SeekableByteChannel channel) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
read
(long pos, ByteBuffer buf) Read content of the stream into aByteBuffer
.private int
readArchive
(long pos, ByteBuffer buf) private int
readSparse
(long pos, ByteBuffer buf, int numToRead) Methods inherited from class org.apache.commons.compress.utils.BoundedArchiveInputStream
read, read
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, readAllBytes, readNBytes, reset, skip, transferTo
-
Field Details
-
channel
-
entry
-
entryOffset
private long entryOffset -
currentSparseInputStreamIndex
private int currentSparseInputStreamIndex
-
-
Constructor Details
-
BoundedTarEntryInputStream
BoundedTarEntryInputStream(TarArchiveEntry entry, SeekableByteChannel channel) throws IOException - Throws:
IOException
-
-
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.
-
readSparse
- Throws:
IOException
-
readArchive
- Throws:
IOException
-