Performs bzz compression/decompression.
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. Destroying the BSByteStream performs an implicit flush.
Alphabetic index HTML hierarchy of classes or Java