diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-06-09 05:43:04 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-06-09 05:43:04 +0000 |
commit | f5352edf3dc23c044a91f1d1537fa0dc0f0babc7 (patch) | |
tree | c08cd1a97a91a0ece860355fe03c1494651db31c /src/tests/bzip2.cpp | |
parent | 9e8a4944e50fab432012878c66e1bdac20649f76 (diff) | |
download | libbu++-f5352edf3dc23c044a91f1d1537fa0dc0f0babc7.tar.gz libbu++-f5352edf3dc23c044a91f1d1537fa0dc0f0babc7.tar.bz2 libbu++-f5352edf3dc23c044a91f1d1537fa0dc0f0babc7.tar.xz libbu++-f5352edf3dc23c044a91f1d1537fa0dc0f0babc7.zip |
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...)
Diffstat (limited to 'src/tests/bzip2.cpp')
-rw-r--r-- | src/tests/bzip2.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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[] ) | |||
6 | char buf[1024]; | 6 | char buf[1024]; |
7 | size_t nRead; | 7 | size_t nRead; |
8 | 8 | ||
9 | Bu::File f( "test.bz2", "wb" ); | 9 | Bu::File f( "test.bz2", "rb" ); |
10 | Bu::BZip2 bz2( f ); | 10 | Bu::BZip2 bz2( f ); |
11 | 11 | ||
12 | Bu::File fin( argv[1], "rb"); | 12 | Bu::File fin( argv[1], "wb"); |
13 | 13 | ||
14 | for(;;) | 14 | for(;;) |
15 | { | 15 | { |
16 | nRead = fin.read( buf, 1024 ); | 16 | nRead = bz2.read( buf, 1024 ); |
17 | if( nRead > 0 ) | 17 | if( nRead > 0 ) |
18 | bz2.write( buf, nRead ); | 18 | fin.write( buf, nRead ); |
19 | if( fin.isEOS() ) | 19 | if( bz2.isEOS() ) |
20 | break; | 20 | break; |
21 | } | 21 | } |
22 | } | 22 | } |