Steve Howell <showel...@yahoo.com> writes: > compressor = zlib.compressobj() > s = compressor.compress("foobar") > s += compressor.flush(zlib.Z_SYNC_FLUSH) > > s_start = s > compressor2 = compressor.copy()
I think you also want to make a decompressor here, and initialize it with s and then clone it. Then you don't have to reinitialize every time you want to decompress something. I also seem to remember that the first few bytes of compressed output are always some fixed string or checksum, that you can strip out after compression and put back before decompression, giving further savings in output size when you have millions of records. -- http://mail.python.org/mailman/listinfo/python-list