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:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- TarFile
private final class TarFile.BoundedTarEntryInputStream extends BoundedArchiveInputStream
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.channels.SeekableByteChannelchannelprivate intcurrentSparseInputStreamIndexprivate TarArchiveEntryentryprivate longentryOffset
-
Constructor Summary
Constructors Constructor Description BoundedTarEntryInputStream(TarArchiveEntry entry, java.nio.channels.SeekableByteChannel channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intread(long pos, java.nio.ByteBuffer buf)Read content of the stream into aByteBuffer.private intreadArchive(long pos, java.nio.ByteBuffer buf)private intreadSparse(long pos, java.nio.ByteBuffer buf, int numToRead)-
Methods inherited from class org.apache.commons.compress.utils.BoundedArchiveInputStream
read, read
-
-
-
-
Field Detail
-
channel
private final java.nio.channels.SeekableByteChannel channel
-
entry
private final TarArchiveEntry entry
-
entryOffset
private long entryOffset
-
currentSparseInputStreamIndex
private int currentSparseInputStreamIndex
-
-
Constructor Detail
-
BoundedTarEntryInputStream
BoundedTarEntryInputStream(TarArchiveEntry entry, java.nio.channels.SeekableByteChannel channel) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
read
protected int read(long pos, java.nio.ByteBuffer buf) throws java.io.IOExceptionDescription copied from class:BoundedArchiveInputStreamRead 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:
java.io.IOException- if I/O fails.
-
readSparse
private int readSparse(long pos, java.nio.ByteBuffer buf, int numToRead) throws java.io.IOException- Throws:
java.io.IOException
-
readArchive
private int readArchive(long pos, java.nio.ByteBuffer buf) throws java.io.IOException- Throws:
java.io.IOException
-
-