|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
org.apache.commons.compress.archivers.tar.TarInputStream
public final class TarInputStream
The TarInputStream reads a UNIX tar archive as an InputStream. methods are provided to position at each successive entry in the archive, and the read each entry as a normal input stream using read().
TarInputStream
,
TarEntry
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
TarInputStream(InputStream input)
Construct a TarInputStream using specified input stream and default block and record sizes. |
|
TarInputStream(InputStream input,
int blockSize)
Construct a TarInputStream using specified input stream, block size and default record sizes. |
|
TarInputStream(InputStream input,
int blockSize,
int recordSize)
Construct a TarInputStream using specified input stream, block size and record sizes. |
Method Summary | |
---|---|
int |
available()
Get the available data that can be read from the current entry in the archive. |
void |
close()
Closes this stream. |
void |
copyEntryContents(OutputStream output)
Copies the contents of the current tar archive entry directly into an output stream. |
protected void |
debug(String message)
Utility method to do debugging. |
TarEntry |
getNextEntry()
Get the next entry in this tar archive. |
int |
getRecordSize()
Get the record size being used by this stream's TarBuffer. |
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. |
int |
read()
Reads a byte from the current tar archive entry. |
int |
read(byte[] buffer)
Reads bytes from the current tar archive entry. |
int |
read(byte[] buffer,
int offset,
int count)
Reads bytes from the current tar archive entry. |
void |
reset()
Since we do not support marking just yet, we do nothing. |
void |
setDebug(boolean debug)
Sets the debugging flag. |
void |
skip(int numToSkip)
Skip bytes in the input buffer. |
Methods inherited from class java.io.FilterInputStream |
---|
skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TarInputStream(InputStream input)
input
- stream to create TarInputStream fromTarBuffer.DEFAULT_BLOCKSIZE
,
TarBuffer.DEFAULT_RECORDSIZE
public TarInputStream(InputStream input, int blockSize)
input
- stream to create TarInputStream fromblockSize
- the block size to useTarBuffer.DEFAULT_RECORDSIZE
public TarInputStream(InputStream input, int blockSize, int recordSize)
input
- stream to create TarInputStream fromblockSize
- the block size to userecordSize
- the record size to useMethod Detail |
---|
public void setDebug(boolean debug)
debug
- The new Debug valuepublic TarEntry getNextEntry() throws IOException
IOException
- Description of Exceptionpublic int getRecordSize()
public int available() throws IOException
available
in class FilterInputStream
IOException
- when an IO error causes operation to failpublic void close() throws IOException
close
in interface Closeable
close
in class FilterInputStream
IOException
- when an IO error causes operation to failpublic void copyEntryContents(OutputStream output) throws IOException
output
- The OutputStream into which to write the entry's data.
IOException
- when an IO error causes operation to failpublic void mark(int markLimit)
mark
in class FilterInputStream
markLimit
- The limit to mark.public boolean markSupported()
markSupported
in class FilterInputStream
public int read() throws IOException
read
in class FilterInputStream
IOException
- when an IO error causes operation to failpublic int read(byte[] buffer) throws IOException
read
in class FilterInputStream
buffer
- The buffer into which to place bytes read.
IOException
- when an IO error causes operation to failpublic int read(byte[] buffer, int offset, int count) throws IOException
read
in class FilterInputStream
buffer
- The buffer into which to place bytes read.offset
- The offset at which to place bytes read.count
- The number of bytes to read.
IOException
- when an IO error causes operation to failpublic void reset()
reset
in class FilterInputStream
public void skip(int numToSkip) throws IOException
numToSkip
- The number of bytes to skip.
IOException
- when an IO error causes operation to failprotected void debug(String message)
message
- the message to use in debugging
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |