org.apache.commons.compress.archivers.tar
public class TarBuffer extends Object
You should never have a need to access this class directly. TarBuffers are created by Tar IO Streams.
Version: $Revision: 155439 $ $Date: 2006-08-28 08:10:02 +0200 (Mon, 28 Aug 2006) $
Field Summary | |
---|---|
static int | DEFAULT_BLOCKSIZE |
static int | DEFAULT_RECORDSIZE |
byte[] | m_blockBuffer |
int | m_blockSize |
int | m_currBlkIdx |
int | m_currRecIdx |
boolean | m_debug |
InputStream | m_input |
OutputStream | m_output |
int | m_recordSize |
int | m_recsPerBlock |
Constructor Summary | |
---|---|
TarBuffer(InputStream input) | |
TarBuffer(InputStream input, int blockSize) | |
TarBuffer(InputStream input, int blockSize, int recordSize) | |
TarBuffer(OutputStream output) | |
TarBuffer(OutputStream output, int blockSize) | |
TarBuffer(OutputStream output, int blockSize, int recordSize) |
Method Summary | |
---|---|
void | close()
Close the TarBuffer. |
protected void | debug(String message) |
void | flushBlock()
Flush the current data block if it has any data in it. |
int | getBlockSize()
Get the TAR Buffer's block size. |
int | getCurrentBlockNum()
Get the current block number, zero based.
|
int | getCurrentRecordNum()
Get the current record number, within the current block, zero based.
|
int | getRecordSize()
Get the TAR Buffer's record size.
|
void | initialize(int blockSize, int recordSize)
Initialization common to all constructors. |
boolean | isEOFRecord(byte[] record)
Determine if an archive record indicate End of Archive. |
boolean | readBlock() |
byte[] | readRecord()
Read a record from the input stream and return the data.
|
void | setDebug(boolean debug)
Set the debugging flag for the buffer.
|
void | skipRecord()
Skip over a record on the input stream. |
void | writeBlock()
Write a TarBuffer block to the archive.
|
void | writeRecord(byte[] record)
Write an archive record to the archive.
|
void | writeRecord(byte[] buffer, int offset)
Write an archive record to the archive, where the record may be inside of
a larger array buffer. |
Returns: The BlockSize value
Returns: The current zero based block number.
Returns: The current zero based record number.
Returns: The RecordSize value
Parameters: record The record data to check.
Returns: The EOFRecord value
Returns: false if End-Of-File, else true
Returns: The record data.
Throws: IOException Description of Exception
Parameters: debug If true, print debugging output.
Throws: IOException Description of Exception
Parameters: record The record data to write to the archive.
Parameters: buffer The buffer containing the record data to write. offset The offset of the record data within buf.