| Modifier and Type | Field and Description |
|---|---|
| protected TarBuffer | |
| private static final int | |
| private static final int | |
| protected TarEntry | |
| protected boolean | |
| private final ZipEncoding | |
| protected long | |
| protected long | |
| protected boolean | |
| private static final int | |
| protected byte[] | oneBuf
This contents of this array is not used at all in this class, it is only here to avoid repeated object creation during calls to the no-arg read method. |
| protected byte[] | |
| private final byte[] | |
| private final byte[] | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | TarInputStream(InputStream
the input stream to use is, String name of the encoding to use for file names encoding)Constructor for TarInputStream. |
| public | TarInputStream(InputStream
the input stream to use is, int the block size to use blockSize)Constructor for TarInputStream. |
| public | TarInputStream(InputStream
the input stream to use is, int the block size to use blockSize, String name of the encoding to use for file names encoding)Constructor for TarInputStream. |
| public | TarInputStream(InputStream
the input stream to use is, int the block size to use blockSize, int the record size to use recordSize)Constructor for TarInputStream. |
| public | TarInputStream(InputStream
the input stream to use is, int the block size to use blockSize, int the record size to use recordSize, String name of the encoding to use for file names encoding)Constructor for TarInputStream. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public int | Returns: The number of available bytes for the current entry.Overrides java. |
| public boolean | Returns: booleanTarEntry te)Whether this class is able to read the given entry. |
| public void | close()
Overrides java. Implements java. |
| public void | copyEntryContents(OutputStream
The OutputStream into which to write the entry's data. out)Copies the contents of the current tar archive entry directly into an output stream. |
| protected byte[] | Returns: The next entry in the archive as longname data, or null.Get the next entry in this tar archive as longname data. |
| public TarEntry | Returns: The next TarEntry in the archive, or null.Get the next entry in this tar archive. |
| private byte[] | Returns: The next header in the archive, or null.Get the next record in this tar archive. |
| public int | Returns: The TarBuffer record size.Get the record size being used by this stream's TarBuffer. |
| private boolean | |
| public void | mark(int
The limit to mark. markLimit)Overrides java. |
| public boolean | Returns: False.Overrides java. |
| pack-priv Map | |
| private void | |
| public int | Returns: The byte read, or -1 at EOF.Overrides java. |
| public int | Returns: The number of bytes read, or -1 at EOF.The buffer into which to place bytes read. buf, int The offset at which to place bytes read. offset, int The number of bytes to read. numToRead)Overrides java. |
| private void | readGNUSparse()
Adds the sparse chunks from the current entry to the sparse chunks, including any additional sparse entries following the current entry. |
| public void | reset()
Overrides java. |
| public void | |
| public long | Returns: the number actually skippedThe number of bytes to skip. numToSkip)Overrides java. |
| buffer | back to summary |
|---|---|
| protected TarBuffer buffer | |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE | |
| BYTE_MASK | back to summary |
|---|---|
| private static final int BYTE_MASK | |
| currEntry | back to summary |
|---|---|
| protected TarEntry currEntry | |
| debug | back to summary |
|---|---|
| protected boolean debug | |
| encoding | back to summary |
|---|---|
| private final ZipEncoding encoding | |
| entryOffset | back to summary |
|---|---|
| protected long entryOffset | |
| entrySize | back to summary |
|---|---|
| protected long entrySize | |
| hasHitEOF | back to summary |
|---|---|
| protected boolean hasHitEOF | |
| LARGE_BUFFER_SIZE | back to summary |
|---|---|
| private static final int LARGE_BUFFER_SIZE | |
| oneBuf | back to summary |
|---|---|
| protected byte[] oneBuf This contents of this array is not used at all in this class, it is only here to avoid repeated object creation during calls to the no-arg read method. | |
| readBuf | back to summary |
|---|---|
| protected byte[] readBuf | |
| SKIP_BUF | back to summary |
|---|---|
| private final byte[] SKIP_BUF | |
| SMALL_BUF | back to summary |
|---|---|
| private final byte[] SMALL_BUF | |
| SMALL_BUFFER_SIZE | back to summary |
|---|---|
| private static final int SMALL_BUFFER_SIZE | |
| TarInputStream | back to summary |
|---|---|
| public TarInputStream(InputStream is) Constructor for TarInputStream.
| |
| TarInputStream | back to summary |
|---|---|
| public TarInputStream(InputStream is, String encoding) Constructor for TarInputStream.
| |
| TarInputStream | back to summary |
|---|---|
| public TarInputStream(InputStream is, int blockSize) Constructor for TarInputStream.
| |
| TarInputStream | back to summary |
|---|---|
| public TarInputStream(InputStream is, int blockSize, String encoding) Constructor for TarInputStream.
| |
| TarInputStream | back to summary |
|---|---|
| public TarInputStream(InputStream is, int blockSize, int recordSize) Constructor for TarInputStream.
| |
| TarInputStream | back to summary |
|---|---|
| public TarInputStream(InputStream is, int blockSize, int recordSize, String encoding) Constructor for TarInputStream.
| |
| applyPaxHeadersToCurrentEntry | back to summary |
|---|---|
| private void applyPaxHeadersToCurrentEntry(Map<String, String> headers) | |
| available | back to summary |
|---|---|
| public int available() throws IOException Overrides java. Get the available data that can be read from the current entry in the archive. This does not indicate how much data is left in the entire archive, only in the current entry. This value is determined from the entry's size header field and the amount of data already read from the current entry. Integer.MAX_VALUE is returned in case more than Integer.MAX_VALUE bytes are left in the current entry in the archive.
| |
| canReadEntryData | back to summary |
|---|---|
| public boolean canReadEntryData(TarEntry te) Whether this class is able to read the given entry. May return false if the current entry is a sparse file.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Closes this stream. Calls the TarBuffer's close() method.
| |
| copyEntryContents | back to summary |
|---|---|
| public void copyEntryContents(OutputStream out) throws IOException Copies the contents of the current tar archive entry directly into an output stream.
| |
| getLongNameData | back to summary |
|---|---|
| protected byte[] getLongNameData() throws IOException Get the next entry in this tar archive as longname data.
| |
| getNextEntry | back to summary |
|---|---|
| public TarEntry getNextEntry() throws IOException Get the next entry in this tar archive. This will skip over any remaining data in the current entry, if there is one, and place the input stream at the header of the next entry, and read the header and instantiate a new TarEntry from the header bytes and return that entry. If there are no more entries in the archive, null will be returned to indicate that the end of the archive has been reached.
| |
| getRecord | back to summary |
|---|---|
| private byte[] getRecord() throws IOException Get the next record in this tar archive. This will skip over any remaining data in the current entry, if there is one, and place the input stream at the header of the next entry. If there are no more entries in the archive, null will be returned to indicate that the end of the archive has been reached.
| |
| getRecordSize | back to summary |
|---|---|
| public int getRecordSize() Get the record size being used by this stream's TarBuffer.
| |
| isDirectory | back to summary |
|---|---|
| private boolean isDirectory() | |
| mark | back to summary |
|---|---|
| public void mark(int markLimit) Overrides java. Since we do not support marking just yet, we do nothing.
| |
| markSupported | back to summary |
|---|---|
| public boolean markSupported() Overrides java. Since we do not support marking just yet, we return false.
| |
| parsePaxHeaders | back to summary |
|---|---|
| pack-priv Map | |
| paxHeaders | back to summary |
|---|---|
| private void paxHeaders() throws IOException | |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Reads a byte from the current tar archive entry. This method simply calls read(byte[], int, int).
| |
| read | back to summary |
|---|---|
| public int read(byte[] buf, int offset, int numToRead) throws IOException Overrides java. Reads bytes from the current tar archive entry. This method is aware of the boundaries of the current entry in the archive and will deal with them as if they were this stream's start and EOF.
| |
| readGNUSparse | back to summary |
|---|---|
| private void readGNUSparse() throws IOException Adds the sparse chunks from the current entry to the sparse chunks, including any additional sparse entries following the current entry.
| |
| reset | back to summary |
|---|---|
| public void reset() Overrides java. Since we do not support marking just yet, we do nothing.
| |
| setDebug | back to summary |
|---|---|
| public void setDebug(boolean debug) Sets the debugging flag.
| |
| skip | back to summary |
|---|---|
| public long skip(long numToSkip) throws IOException Overrides java. Skip bytes in the input buffer. This skips bytes in the current entry's data, not the entire archive, and will stop at the end of the current entry's data if the number to skip extends beyond that point.
| |