org.apache.tools.tar
public class TarBuffer extends Object
You should never have a need to access this class directly. TarBuffers are created by Tar IO Streams.
Field Summary | |
---|---|
static int | DEFAULT_BLKSIZE Default block size |
static int | DEFAULT_RCDSIZE Default record size |
Constructor Summary | |
---|---|
TarBuffer(InputStream inStream)
Constructor for a TarBuffer on an input stream. | |
TarBuffer(InputStream inStream, int blockSize)
Constructor for a TarBuffer on an input stream. | |
TarBuffer(InputStream inStream, int blockSize, int recordSize)
Constructor for a TarBuffer on an input stream. | |
TarBuffer(OutputStream outStream)
Constructor for a TarBuffer on an output stream. | |
TarBuffer(OutputStream outStream, int blockSize)
Constructor for a TarBuffer on an output stream. | |
TarBuffer(OutputStream outStream, int blockSize, int recordSize)
Constructor for a TarBuffer on an output stream. |
Method Summary | |
---|---|
void | close()
Close the TarBuffer. |
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. |
boolean | isEOFRecord(byte[] record)
Determine if an archive record indicate End of Archive. |
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 | writeRecord(byte[] record)
Write an archive record to the archive.
|
void | writeRecord(byte[] buf, int offset)
Write an archive record to the archive, where the record may be
inside of a larger array buffer. |
Parameters: inStream the input stream to use
Parameters: inStream the input stream to use blockSize the block size to use
Parameters: inStream the input stream to use blockSize the block size to use recordSize the record size to use
Parameters: outStream the output stream to use
Parameters: outStream the output stream to use blockSize the block size to use
Parameters: outStream the output stream to use blockSize the block size to use recordSize the record size to use
Throws: IOException on error
Returns: the block size
Returns: The current zero based block number.
Returns: The current zero based record number.
Returns: the record size
Parameters: record The record data to check.
Returns: true if the record data is an End of Archive
Returns: The record data.
Throws: IOException on error
Parameters: debug If true, print debugging output.
Throws: IOException on error
Parameters: record The record data to write to the archive.
Throws: IOException on error
Parameters: buf The buffer containing the record data to write. offset The offset of the record data within buf.
Throws: IOException on error