public class TarInputStream extends BufferedInputStream
Constructor and Description |
---|
TarInputStream(InputStream in) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeCurrentEntry()
Closes the current tar entry
|
TarEntry |
getNextEntry()
Returns the next entry in the tar file
|
boolean |
isDefaultSkip() |
void |
mark(int readlimit)
Not supported
|
boolean |
markSupported()
Tests if this input stream supports the
mark
and reset methods. |
int |
read()
Read a byte
|
int |
read(byte[] b,
int off,
int len)
Checks if the bytes being read exceed the entry size and adjusts the byte
array length.
|
void |
reset()
Not supported
|
void |
setDefaultSkip(boolean defaultSkip) |
long |
skip(long n)
Skips 'n' bytes on the InputStream
Overrides default implementation of skip |
protected void |
skipPad()
Skips the pad at the end of each tar entry file content
|
available, close, getConnection, getDefaultBufferSize, getInternal, getLastActivityTime, getName, getTotalBytesRead, getYield, isDisableBuffering, isPrintInput, read, setConnection, setDefaultBufferSize, setDisableBuffering, setPrintInput, setProgressListener, setYield, stop
public TarInputStream(InputStream in)
public boolean markSupported()
BufferedInputStream
mark
and reset
methods. The markSupported
method of BufferedInputStream
returns
true
.markSupported
in class BufferedInputStream
boolean
indicating if this stream type supports
the mark
and reset
methods.InputStream.mark(int)
,
InputStream.reset()
public void mark(int readlimit)
mark
in class BufferedInputStream
readlimit
- the maximum limit of bytes that can be read before
the mark position becomes invalid.public void reset() throws IOException
reset
in class BufferedInputStream
IOException
- if this stream has not been marked or,
if the mark has been invalidated, or the stream
has been closed by invoking its BufferedInputStream.close()
method, or an I/O error occurs.public int read() throws IOException
read
in class BufferedInputStream
-1
if the end of the
stream is reached.IOException
- if this input stream has been closed by
invoking its BufferedInputStream.close()
method,
or an I/O error occurs.FilterInputStream.read()
public int read(byte[] b, int off, int len) throws IOException
read
in class BufferedInputStream
b
- destination buffer.off
- offset at which to start storing bytes.len
- maximum number of bytes to read.-1
if the end of
the stream has been reached.IOException
- if this input stream has been closed by
invoking its BufferedInputStream.close()
method,
or an I/O error occurs.FilterInputStream.read(byte[], int, int)
public TarEntry getNextEntry() throws IOException
IOException
protected void closeCurrentEntry() throws IOException
IOException
protected void skipPad() throws IOException
IOException
public long skip(long n) throws IOException
skip
in class BufferedInputStream
IOException
- if the stream does not support seek,
or if this input stream has been closed by
invoking its BufferedInputStream.close()
method, or an
I/O error occurs.public boolean isDefaultSkip()
public void setDefaultSkip(boolean defaultSkip)