public class TarArchiveInputStream extends ArchiveInputStream
| Constructor and Description |
|---|
TarArchiveInputStream(InputStream
Constructor for TarInputStream.
|
TarArchiveInputStream(InputStream
Constructor for TarInputStream.
|
TarArchiveInputStream(InputStream
Constructor for TarInputStream.
|
TarArchiveInputStream(InputStream
Constructor for TarInputStream.
|
TarArchiveInputStream(InputStream
Constructor for TarInputStream.
|
TarArchiveInputStream(InputStream
Constructor for TarInputStream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Get the available data that can be read from the current entry in the archive.
|
boolean |
canReadEntryData(ArchiveEntry
Whether this class is able to read the given entry.
|
void |
close()
Closes this stream.
|
TarArchiveEntry |
getCurrentEntry()
Get the current TAR Archive Entry that this input stream is processing
|
protected byte[] |
getLongNameData()
Get the next entry in this tar archive as longname data.
|
ArchiveEntry |
getNextEntry()
Returns the next Archive Entry in this Stream.
|
TarArchiveEntry |
getNextTarEntry()
Get the next entry in this tar archive.
|
int |
getRecordSize()
Get the record size being used by this stream's buffer.
|
protected boolean |
isAtEOF()
|
protected boolean |
isEOFRecord(byte[] record)
Determine if an archive record indicate End of Archive.
|
static boolean |
matches(byte[] signature, int length)
Checks if the signature matches what is expected for a tar file.
|
int |
read(byte[] buf, int offset, int numToRead)
Reads bytes from the current tar archive entry.
|
protected byte[] |
readRecord()
Read a record from the input stream and return the data.
|
void |
reset()
Since we do not support marking just yet, we do nothing.
|
protected void |
setAtEOF(boolean b)
|
protected void |
setCurrentEntry(TarArchiveEntry
|
long |
skip(long numToSkip)
Skip bytes in the input buffer.
|
count, count, getBytesRead, getCount, pushedBackBytes, readmark, markSupported, readpublic TarArchiveInputStream(InputStreamis)
is - the input stream to use
public TarArchiveInputStream(InputStreamis, String encoding)
is - the input stream to use
encoding - name of the encoding to use for file names
public TarArchiveInputStream(InputStreamis, int blockSize)
is - the input stream to use
blockSize - the block size to use
public TarArchiveInputStream(InputStreamis, int blockSize, String encoding)
is - the input stream to use
blockSize - the block size to use
encoding - name of the encoding to use for file names
public TarArchiveInputStream(InputStreamis, int blockSize, int recordSize)
is - the input stream to use
blockSize - the block size to use
recordSize - the record size to use
public TarArchiveInputStream(InputStreamis, int blockSize, int recordSize, String encoding)
is - the input stream to use
blockSize - the block size to use
recordSize - the record size to use
encoding - name of the encoding to use for file names
public void close()
throws IOException
close in interface
Closeable
close in interface
AutoCloseable
close in class
InputStream
IOException - on error
public int getRecordSize()
public int available()
throws IOException
available in class
InputStream
IOException - for signature
public long skip(long numToSkip)
throws IOException
skip in class
InputStream
numToSkip - The number of bytes to skip.
IOException - on error
public void reset()
public TarArchiveEntrygetNextTarEntry() throws IOException
IOException - on error
protected byte[] getLongNameData()
throws IOException
IOException - on error
protected boolean isEOFRecord(byte[] record)
record - The record data to check.
protected byte[] readRecord()
throws IOException
IOException - on error
public ArchiveEntrygetNextEntry() throws IOException
getNextEntry in class
ArchiveInputStream
null if there are no more entries
IOException - if the next entry could not be read
public int read(byte[] buf,
int offset,
int numToRead)
throws IOException
read in class
InputStream
buf - The buffer into which to place bytes read.
offset - The offset at which to place bytes read.
numToRead - The number of bytes to read.
IOException - on error
public boolean canReadEntryData(ArchiveEntryae)
May return false if the current entry is a sparse file.
canReadEntryData in class
ArchiveInputStream
ae - the entry to test
public TarArchiveEntrygetCurrentEntry()
protected final void setCurrentEntry(TarArchiveEntrye)
protected final boolean isAtEOF()
protected final void setAtEOF(boolean b)
public static boolean matches(byte[] signature,
int length)
signature - the bytes to check
length - the number of bytes to check