From: Aaron Isotton <aaron@isotton.com>
Subject: GPL: bz2stream 0.1.0
Date: 7 Jul 2002 06:45:21 GMT [thread overview]
Message-ID: <87y9cpve6k.fsf@isotton.com> (raw)
I'm happy to announce the first release (0.1.0) of bz2stream, a set of
C++ stream classes wrapping libbzip2.
The streams do not write the data to any default destination, but to
another stream buffer. This gives you the maximun possible
flexibility. You just create a "normal" input or output stream, and
then use pass its stream buffer to the bz2 stream. The bz2 stream acts
as a filter, compressing or decompressing all the data you pass it.
For example, to read in a file and compress it to another file, a
program as the following would be enough:
#include "bz2stream.hpp"
#include <iostream>
#include <fstream>
int main(int argc, char** argv) {
std::ifstream infile(argv[1], std::ios::binary);
std::ofstream outfile(argv[2], std::ios::binary);
bz2ostream out(outfile.rdbuf());
out << infile.rdbuf();
}
The performance loss because of the use of the stream classes and not
of direct calls to libbzip2's API is virtually non existant. This
program is as fast as bzip2.
The use of the bz2 stream classes is especially easy because there are
no libraries you need to link to; you only need to include the
bz2stream.hpp header. (Of course you must link against libbz2).
This is an early release; this code is tested, but not ready for
applications where absolute reliability is a must.
bz2stream is available at http://www.isotton.com/bz2stream/. It is
released under the GNU GPL and includes HTML documentation.
Aaron Isotton
http://www.isotton.com/
My GPG public key: http://www.isotton.com/gpg-public-key
##########################################################################
# Send submissions for comp.os.linux.announce to: cola@stump.algebra.com #
# PLEASE remember a short description of the software and the LOCATION. #
# This group is archived at http://stump.algebra.com/~cola/ #
##########################################################################
reply other threads:[~2002-07-07 6:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox