public class TarArchiveInputStream extends ArchiveInputStream
| Constructor and Description |
|---|
TarArchiveInputStream(java.io.InputStream is)
Constructor for TarInputStream.
|
TarArchiveInputStream(java.io.InputStream is,
int blockSize)
Constructor for TarInputStream.
|
TarArchiveInputStream(java.io.InputStream is,
int blockSize,
int recordSize)
Constructor for TarInputStream.
|
TarArchiveInputStream(java.io.InputStream is,
int blockSize,
int recordSize,
java.lang.String encoding)
Constructor for TarInputStream.
|
TarArchiveInputStream(java.io.InputStream is,
int blockSize,
java.lang.String encoding)
Constructor for TarInputStream.
|
TarArchiveInputStream(java.io.InputStream is,
java.lang.String encoding)
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 ae)
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
|
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.
|
void |
mark(int markLimit)
Since we do not support marking just yet, we do nothing.
|
boolean |
markSupported()
Since we do not support marking just yet, we return false.
|
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.
|
void |
reset()
Since we do not support marking just yet, we do nothing.
|
long |
skip(long n)
Skips over and discards
n bytes of data from this input
stream. |
getBytesRead, getCount, readpublic TarArchiveInputStream(java.io.InputStream is)
is - the input stream to usepublic TarArchiveInputStream(java.io.InputStream is,
java.lang.String encoding)
is - the input stream to useencoding - name of the encoding to use for file namespublic TarArchiveInputStream(java.io.InputStream is,
int blockSize)
is - the input stream to useblockSize - the block size to usepublic TarArchiveInputStream(java.io.InputStream is,
int blockSize,
java.lang.String encoding)
is - the input stream to useblockSize - the block size to useencoding - name of the encoding to use for file namespublic TarArchiveInputStream(java.io.InputStream is,
int blockSize,
int recordSize)
is - the input stream to useblockSize - the block size to userecordSize - the record size to usepublic TarArchiveInputStream(java.io.InputStream is,
int blockSize,
int recordSize,
java.lang.String encoding)
is - the input stream to useblockSize - the block size to userecordSize - the record size to useencoding - name of the encoding to use for file namespublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOException - on errorpublic int getRecordSize()
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOException - for signaturepublic long skip(long n)
throws java.io.IOException
n bytes of data from this input
stream. The skip method may, for a variety of reasons, end
up skipping over some smaller number of bytes, possibly 0.
This may result from any of a number of conditions; reaching end of file
or end of entry before n bytes have been skipped; are only
two possibilities. The actual number of bytes skipped is returned. If
n is negative, no bytes are skipped.skip in class java.io.InputStreamn - the number of bytes to be skipped.java.io.IOException - if some other I/O error occurs.public boolean markSupported()
markSupported in class java.io.InputStreampublic void mark(int markLimit)
mark in class java.io.InputStreammarkLimit - The limit to mark.public void reset()
reset in class java.io.InputStreampublic TarArchiveEntry getNextTarEntry() throws java.io.IOException
java.io.IOException - on errorpublic ArchiveEntry getNextEntry() throws java.io.IOException
getNextEntry in class ArchiveInputStreamnull if there are no more entriesjava.io.IOException - if the next entry could not be readpublic int read(byte[] buf,
int offset,
int numToRead)
throws java.io.IOException
read in class java.io.InputStreambuf - The buffer into which to place bytes read.offset - The offset at which to place bytes read.numToRead - The number of bytes to read.java.io.IOException - on errorpublic boolean canReadEntryData(ArchiveEntry ae)
May return false if the current entry is a sparse file.
canReadEntryData in class ArchiveInputStreamae - the entry to testpublic TarArchiveEntry getCurrentEntry()
public static boolean matches(byte[] signature,
int length)
signature - the bytes to checklength - the number of bytes to check"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"