|
||||||||||
| 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 | |
|---|---|
private TarBuffer |
m_buffer
|
private TarEntry |
m_currEntry
|
private boolean |
m_debug
|
private int |
m_entryOffset
|
private int |
m_entrySize
|
private boolean |
m_hasHitEOF
|
private byte[] |
m_oneBuf
|
private byte[] |
m_readBuf
|
| Fields inherited from class java.io.FilterInputStream |
|---|
in |
| Constructor Summary | |
|---|---|
TarInputStream(java.io.InputStream input)
Construct a TarInputStream using specified input stream and default block and record sizes. |
|
TarInputStream(java.io.InputStream input,
int blockSize)
Construct a TarInputStream using specified input stream, block size and default record sizes. |
|
TarInputStream(java.io.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(java.io.OutputStream output)
Copies the contents of the current tar archive entry directly into an output stream. |
protected void |
debug(java.lang.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 |
| Field Detail |
|---|
private TarBuffer m_buffer
private TarEntry m_currEntry
private boolean m_debug
private int m_entryOffset
private int m_entrySize
private boolean m_hasHitEOF
private byte[] m_oneBuf
private byte[] m_readBuf
| Constructor Detail |
|---|
public TarInputStream(java.io.InputStream input)
input - stream to create TarInputStream fromTarBuffer.DEFAULT_BLOCKSIZE,
TarBuffer.DEFAULT_RECORDSIZE
public TarInputStream(java.io.InputStream input,
int blockSize)
input - stream to create TarInputStream fromblockSize - the block size to useTarBuffer.DEFAULT_RECORDSIZE
public TarInputStream(java.io.InputStream input,
int blockSize,
int recordSize)
input - stream to create TarInputStream fromblockSize - the block size to userecordSize - the record size to use| Method Detail |
|---|
public void setDebug(boolean debug)
debug - The new Debug value
public TarEntry getNextEntry()
throws java.io.IOException
java.io.IOException - Description of Exceptionpublic int getRecordSize()
public int available()
throws java.io.IOException
available in class java.io.FilterInputStreamjava.io.IOException - when an IO error causes operation to fail
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.FilterInputStreamjava.io.IOException - when an IO error causes operation to fail
public void copyEntryContents(java.io.OutputStream output)
throws java.io.IOException
output - The OutputStream into which to write the entry's data.
java.io.IOException - when an IO error causes operation to failpublic void mark(int markLimit)
mark in class java.io.FilterInputStreammarkLimit - The limit to mark.public boolean markSupported()
markSupported in class java.io.FilterInputStream
public int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOException - when an IO error causes operation to fail
public int read(byte[] buffer)
throws java.io.IOException
read in class java.io.FilterInputStreambuffer - The buffer into which to place bytes read.
java.io.IOException - when an IO error causes operation to fail
public int read(byte[] buffer,
int offset,
int count)
throws java.io.IOException
read in class java.io.FilterInputStreambuffer - The buffer into which to place bytes read.offset - The offset at which to place bytes read.count - The number of bytes to read.
java.io.IOException - when an IO error causes operation to failpublic void reset()
reset in class java.io.FilterInputStream
public void skip(int numToSkip)
throws java.io.IOException
numToSkip - The number of bytes to skip.
java.io.IOException - when an IO error causes operation to failprotected void debug(java.lang.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 | |||||||||