Saturday, January 02, 2010

Flush() in a compressed stream

I finally understood the difference between 'sync' and partial flush:

Since last byte may not end on a 8-bit boundary - you need to pad, i.e. to end the current compression block and start a new one.  The interesting part is that a flush with Z_SYNC_FLUSH inserts 0x00 0x00 0xFF 0xFF - but protocols like PPP can strip it.

Another good link:

No comments: