org.apache.commons.compress.archivers.tar
public final class TarOutputStream extends FilterOutputStream
Version: $Revision: 155439 $ $Date: 2006-08-28 08:10:02 +0200 (Mon, 28 Aug 2006) $
See Also: TarInputStream TarEntry
Field Summary | |
---|---|
static int | LONGFILE_ERROR
Flag to indicate that an error should be generated if
an attempt is made to write an entry that exceeds the 100 char
POSIX limit. |
static int | LONGFILE_GNU
Flag to indicate that entry name should be formatted
according to GNU tar extension if an attempt is made
to write an entry that exceeds the 100 char POSIX
limit. |
static int | LONGFILE_TRUNCATE
Flag to indicate that entry name should be truncated if
an attempt is made to write an entry that exceeds the 100 char
POSIX limit. |
byte[] | m_assemBuf |
int | m_assemLen |
TarBuffer | m_buffer |
int | m_currBytes |
int | m_currSize |
int | m_longFileMode |
byte[] | m_oneBuf |
byte[] | m_recordBuf |
Constructor Summary | |
---|---|
TarOutputStream(OutputStream output)
Construct a TarOutputStream using specified input
stream and default block and record sizes.
| |
TarOutputStream(OutputStream output, int blockSize)
Construct a TarOutputStream using specified input
stream, block size and default record sizes.
| |
TarOutputStream(OutputStream output, int blockSize, int recordSize)
Construct a TarOutputStream using specified input
stream, block size and record sizes.
|
Method Summary | |
---|---|
void | close()
Ends the TAR archive and closes the underlying OutputStream. |
void | closeEntry()
Close an entry. |
void | copyEntryContents(InputStream input)
Copies the contents of the specified stream into current tar
archive 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 | setLongFileMode(int longFileMode)
Set the mode used to work with entrys exceeding
100 chars (and thus break the POSIX standard).
|
void | write(int data)
Writes a byte to the current tar archive entry. |
void | write(byte[] buffer)
Writes bytes to the current tar archive entry. |
void | write(byte[] buffer, int offset, int count)
Writes bytes to the current tar archive entry. |
void | writeEOFRecord()
Write an EOF (end of archive) record to the tar archive. |
Parameters: output stream to create TarOutputStream from
See Also: DEFAULT_BLOCKSIZE DEFAULT_RECORDSIZE
Parameters: output stream to create TarOutputStream from blockSize the block size
See Also: DEFAULT_RECORDSIZE
Parameters: output stream to create TarOutputStream from blockSize the block size recordSize the record size
Throws: IOException when an IO error causes operation to fail
Throws: IOException when an IO error causes operation to fail
Parameters: input The InputStream from which to read entrys data
Throws: IOException when an IO error causes operation to fail
Throws: IOException when an IO error causes operation to fail
Returns: The TarBuffer record size.
Parameters: entry The TarEntry to be written to the archive.
Throws: IOException when an IO error causes operation to fail
Parameters: debug The new BufferDebug value
Parameters: longFileMode the mode
Parameters: data The byte written.
Throws: IOException when an IO error causes operation to fail
Parameters: buffer The buffer to write to the archive.
Throws: IOException when an IO error causes operation to fail
Parameters: buffer The buffer to write to the archive. offset The offset in the buffer from which to get bytes. count The number of bytes to write.
Throws: IOException when an IO error causes operation to fail
Throws: IOException when an IO error causes operation to fail