You should never have a need to access this class directly. TarBuffers are created by Tar IO Streams.
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final int | |
| private int | |
| private int | |
| private boolean | |
| public static final int | DEFAULT_BLKSIZE
Default block size |
| public static final int | DEFAULT_RCDSIZE
Default record size |
| private InputStream | |
| private OutputStream | |
| private final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | TarBuffer(InputStream
the input stream to use inStream)Constructor for a TarBuffer on an input stream. |
| public | TarBuffer(InputStream
the input stream to use inStream, int the block size to use blockSize)Constructor for a TarBuffer on an input stream. |
| public | TarBuffer(InputStream
the input stream to use inStream, int the block size to use blockSize, int the record size to use recordSize)Constructor for a TarBuffer on an input stream. |
| public | TarBuffer(OutputStream
the output stream to use outStream)Constructor for a TarBuffer on an output stream. |
| public | TarBuffer(OutputStream
the output stream to use outStream, int the block size to use blockSize)Constructor for a TarBuffer on an output stream. |
| public | TarBuffer(OutputStream
the output stream to use outStream, int the block size to use blockSize, int the record size to use recordSize)Constructor for a TarBuffer on an output stream. |
| private | TarBuffer(InputStream inStream, OutputStream outStream, int blockSize, int recordSize)
Private constructor to perform common setup. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| pack-priv void | |
| public int | |
| public int | Returns: The current zero based block number.Get the current block number, zero based. |
| public int | Returns: The current zero based record number.Get the current record number, within the current block, zero based. |
| public int | |
| public boolean | Returns: true if the record data is an End of ArchiveThe record data to check. record)Determine if an archive record indicate End of Archive. |
| private boolean | |
| public byte[] | |
| public void | |
| public void | |
| private void | |
| public void | writeRecord(byte[]
The record data to write to the archive. record)Write an archive record to the archive. |
| public void | writeRecord(byte[]
The buffer containing the record data to write. buf, int The offset of the record data within buf. offset)Write an archive record to the archive, where the record may be inside of a larger array buffer. |
| blockBuffer | back to summary |
|---|---|
| private final byte[] blockBuffer | |
| blockSize | back to summary |
|---|---|
| private final int blockSize | |
| currBlkIdx | back to summary |
|---|---|
| private int currBlkIdx | |
| currRecIdx | back to summary |
|---|---|
| private int currRecIdx | |
| debug | back to summary |
|---|---|
| private boolean debug | |
| DEFAULT_BLKSIZE | back to summary |
|---|---|
| public static final int DEFAULT_BLKSIZE Default block size | |
| DEFAULT_RCDSIZE | back to summary |
|---|---|
| public static final int DEFAULT_RCDSIZE Default record size | |
| inStream | back to summary |
|---|---|
| private InputStream inStream | |
| outStream | back to summary |
|---|---|
| private OutputStream outStream | |
| recordSize | back to summary |
|---|---|
| private final int recordSize | |
| recsPerBlock | back to summary |
|---|---|
| private final int recsPerBlock | |
| TarBuffer | back to summary |
|---|---|
| public TarBuffer(InputStream inStream) Constructor for a TarBuffer on an input stream.
| |
| TarBuffer | back to summary |
|---|---|
| public TarBuffer(InputStream inStream, int blockSize) Constructor for a TarBuffer on an input stream.
| |
| TarBuffer | back to summary |
|---|---|
| public TarBuffer(InputStream inStream, int blockSize, int recordSize) Constructor for a TarBuffer on an input stream.
| |
| TarBuffer | back to summary |
|---|---|
| public TarBuffer(OutputStream outStream) Constructor for a TarBuffer on an output stream.
| |
| TarBuffer | back to summary |
|---|---|
| public TarBuffer(OutputStream outStream, int blockSize) Constructor for a TarBuffer on an output stream.
| |
| TarBuffer | back to summary |
|---|---|
| public TarBuffer(OutputStream outStream, int blockSize, int recordSize) Constructor for a TarBuffer on an output stream.
| |
| TarBuffer | back to summary |
|---|---|
| private TarBuffer(InputStream inStream, OutputStream outStream, int blockSize, int recordSize) Private constructor to perform common setup. | |
| close | back to summary |
|---|---|
| public void close() throws IOException Close the TarBuffer. If this is an output buffer, also flush the current block before closing.
| |
| flushBlock | back to summary |
|---|---|
| pack-priv void flushBlock() throws IOException Flush the current data block if it has any data in it. | |
| getBlockSize | back to summary |
|---|---|
| public int getBlockSize() Get the TAR Buffer's block size. Blocks consist of multiple records.
| |
| getCurrentBlockNum | back to summary |
|---|---|
| public int getCurrentBlockNum() Get the current block number, zero based.
| |
| getCurrentRecordNum | back to summary |
|---|---|
| public int getCurrentRecordNum() Get the current record number, within the current block, zero based. Thus, current offset = (currentBlockNum * recsPerBlk) + currentRecNum.
| |
| getRecordSize | back to summary |
|---|---|
| public int getRecordSize() Get the TAR Buffer's record size.
| |
| isEOFRecord | back to summary |
|---|---|
| public boolean isEOFRecord(byte[] record) Determine if an archive record indicate End of Archive. End of archive is indicated by a record that consists entirely of null bytes.
| |
| readBlock | back to summary |
|---|---|
private boolean readBlock() throws IOException
| |
| readRecord | back to summary |
|---|---|
| public byte[] readRecord() throws IOException Read a record from the input stream and return the data.
| |
| setDebug | back to summary |
|---|---|
| public void setDebug(boolean debug) Set the debugging flag for the buffer.
| |
| skipRecord | back to summary |
|---|---|
| public void skipRecord() throws IOException Skip over a record on the input stream.
| |
| writeBlock | back to summary |
|---|---|
| private void writeBlock() throws IOException Write a TarBuffer block to the archive. | |
| writeRecord | back to summary |
|---|---|
| public void writeRecord(byte[] record) throws IOException Write an archive record to the archive.
| |
| writeRecord | back to summary |
|---|---|
| public void writeRecord(byte[] buf, int offset) throws IOException Write an archive record to the archive, where the record may be inside of a larger array buffer. The buffer must be "offset plus record size" long.
| |