From f5352edf3dc23c044a91f1d1537fa0dc0f0babc7 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 9 Jun 2007 05:43:04 +0000 Subject: Alright, looks like the bzip2 filter can decompress just fine. It won't try to compensate for overshooting the end of the compression block yet, which it won't be able to do on streams that don't support seeking...I think I'll make it only try on stop commands, and try to re-use the buffer otherwise...maybe...it's an interesting problem since it *always* overshoots (unless you're really, really lucky...) --- src/tests/bzip2.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tests/bzip2.cpp') diff --git a/src/tests/bzip2.cpp b/src/tests/bzip2.cpp index 683d3d7..ef9328f 100644 --- a/src/tests/bzip2.cpp +++ b/src/tests/bzip2.cpp @@ -6,17 +6,17 @@ int main( int argc, char *argv[] ) char buf[1024]; size_t nRead; - Bu::File f( "test.bz2", "wb" ); + Bu::File f( "test.bz2", "rb" ); Bu::BZip2 bz2( f ); - Bu::File fin( argv[1], "rb"); + Bu::File fin( argv[1], "wb"); for(;;) { - nRead = fin.read( buf, 1024 ); + nRead = bz2.read( buf, 1024 ); if( nRead > 0 ) - bz2.write( buf, nRead ); - if( fin.isEOS() ) + fin.write( buf, nRead ); + if( bz2.isEOS() ) break; } } -- cgit v1.2.3