org.apache.tools.tar
public class TarOutputStream extends FilterOutputStream
Field Summary | |
---|---|
protected byte[] | assemBuf |
protected int | assemLen |
protected TarBuffer | buffer |
protected long | currBytes |
protected String | currName |
protected long | currSize |
protected boolean | debug |
protected int | longFileMode |
static int | LONGFILE_ERROR Fail if a long file name is required in the archive. |
static int | LONGFILE_GNU GNU tar extensions are used to store long file names in the archive. |
static int | LONGFILE_TRUNCATE Long paths will be truncated in the archive. |
protected byte[] | oneBuf |
protected byte[] | recordBuf |
Constructor Summary | |
---|---|
TarOutputStream(OutputStream os)
Constructor for TarInputStream. | |
TarOutputStream(OutputStream os, int blockSize)
Constructor for TarInputStream. | |
TarOutputStream(OutputStream os, int blockSize, int recordSize)
Constructor for TarInputStream. |
Method Summary | |
---|---|
void | close()
Ends the TAR archive and closes the underlying OutputStream.
|
void | closeEntry()
Close an entry. |
void | finish()
Ends the TAR archive without closing the underlying OutputStream.
|
int | getRecordSize()
Get the record size being used by this stream's TarBuffer.
|
void | putNextEntry(TarEntry entry)
Put an entry on the output stream. |
void | setBufferDebug(boolean debug)
Sets the debugging flag in this stream's TarBuffer.
|
void | setDebug(boolean debugF)
Sets the debugging flag.
|
void | setLongFileMode(int longFileMode)
Set the long file mode.
|
void | write(int b)
Writes a byte to the current tar archive entry.
|
void | write(byte[] wBuf)
Writes bytes to the current tar archive entry.
|
void | write(byte[] wBuf, int wOffset, int numToWrite)
Writes bytes to the current tar archive entry. |
Parameters: os the output stream to use
Parameters: os the output stream to use blockSize the block size to use
Parameters: os the output stream to use blockSize the block size to use recordSize the record size to use
Throws: IOException on error
Throws: IOException on error
Throws: IOException on error
Returns: The TarBuffer record size.
Parameters: entry The TarEntry to be written to the archive.
Throws: IOException on error
Parameters: debug True to turn on debugging.
Parameters: debugF True to turn on debugging.
Parameters: longFileMode the mode to use
Parameters: b The byte written.
Throws: IOException on error
Parameters: wBuf The buffer to write to the archive.
Throws: IOException on error
Parameters: wBuf The buffer to write to the archive. wOffset The offset in the buffer from which to get bytes. numToWrite The number of bytes to write.
Throws: IOException on error