Daniel
unread,Jan 8, 2011, 7:42:59 PM1/8/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ZipMT
ZipMT seems to work great, but certain input data would always fail
with:
BZError 3
BZError 3
...
Error Occured while compressing data
This happens in stream mode only.
That error is "BZ_FINISH_OK". Turns out that a chunk of data was so
incompressible that it actually expanded, and BZ2_bzCompress() was
running out of space to write the compressed data, so returned this
code, expecting the calling program to call it again with more space
to keep writing. I solved the problem by increasing the value of
WRITEBUFZ by some arbitrary value. Testing with random data suggested
8 kB is not sufficient, but 9 kB appears to do the trick. So line 17
would read:
#define WRITEBUFZ READBUFZ + 9216
Thanks for this useful program!
-D.