From 9e8a4944e50fab432012878c66e1bdac20649f76 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 7 Jun 2007 19:56:20 +0000 Subject: The Stream Filter archetecture is finished, it's actually much cooler than I had anticipated, and much cleaner. I'll have to add some documentation to it, because it's not really obvious how any of it fits together from the outset, although I have to say that the bzip2 test program is the easiest general bzip2 compression program I've ever made...it just goes :) Decompression in Bu::BZip2 isn't finished yet, but that's ok, it's coming soon. --- src/tests/bzip2.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/tests/bzip2.cpp (limited to 'src/tests/bzip2.cpp') diff --git a/src/tests/bzip2.cpp b/src/tests/bzip2.cpp new file mode 100644 index 0000000..683d3d7 --- /dev/null +++ b/src/tests/bzip2.cpp @@ -0,0 +1,23 @@ +#include "bu/bzip2.h" +#include "bu/file.h" + +int main( int argc, char *argv[] ) +{ + char buf[1024]; + size_t nRead; + + Bu::File f( "test.bz2", "wb" ); + Bu::BZip2 bz2( f ); + + Bu::File fin( argv[1], "rb"); + + for(;;) + { + nRead = fin.read( buf, 1024 ); + if( nRead > 0 ) + bz2.write( buf, nRead ); + if( fin.isEOS() ) + break; + } +} + -- cgit v1.2.3