You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.
Hiroshige Hayashizaki edited this page Aug 20, 2015
·
1 revision
#Notes for developing compression spec.
Python zlib snippets
Sync flush (empty uncompressed block)
import zlib
c = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -zlib.MAX_WBITS)
b = c.compress('abcdefghijklmnopqrstuvwxyz')
b += c.flush(zlib.Z_SYNC_FLUSH)
b
Finish with BFINAL
import zlib
c = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -zlib.MAX_WBITS)
b = c.compress('abcdefghijklmnopqrstuvwxyz')
b += c.flush(zlib.Z_FINISH)
b