Performs bzz compression/decompression.
class Stdioclass Staticclass Memoryclass Virtual Functions.
Utility Functions.
Performs bzz compression/decompression.Class BSByteStream defines a ByteStream which transparently performs the BZZ compression/decompression. The constructor of class BSByteStream takes another ByteStream as argument. Any data written to the BSByteStream is compressed and written to this second ByteStream. Any data read from the BSByteStream is internally generated by decompressing data read from the second ByteStream.
Program bzz demonstrates how to use this class. All the hard work is achieved by a simple ByteStream to ByteStream copy, as shown below.
StdioByteStream in(infile,"rb"); StdioByteStream out(outfile,"wb"); if (encoding) { BSByteStream bsb(&out, blocksize); bsb.copy(in); } else { BSByteStream bsb(&in); out.copy(bsb); }Due to the block oriented nature of the Burrows-Wheeler transform, there is a very significant latency between the data input and the data output. You can use function flush to force data output at the expense of compression efficiency.You should never directly access a ByteStream object connected to a valid BSByteStream object. The ByteStream object can be accessed again after the destruction of the BSByteStream object. Note that the encoder always flushes its internal buffers and writes a few final code bytes when the BSByteStream object is destroyed. Note also that the decoder often reads a few bytes beyond the last code byte written by the encoder. This lag means that you must reposition the ByteStream after the destruction of the BSByteStream object and before re-using the ByteStream object (see IFFByteStream.)
Alphabetic index HTML hierarchy of classes or Java