image-rs / deflate-rs

An implementation of a DEFLATE encoder in rust
Apache License 2.0
53 stars 14 forks source link

Implement further ZLIB flush modes. #9

Open oyvindln opened 7 years ago

oyvindln commented 7 years ago

Using flush on the writer currently ends the compression stream and writes a trailer (without resetting the encoder.) The writers in flate2 calls miniz/zlib with SYNC_FLUSH, which outputs the current pending data and adds an empty block at the end. This is probably the behaviour we should emulate.

oyvindln commented 7 years ago

Sync flush has been implemented, but I'll leave the issue open for now.

oyvindln commented 7 years ago

May want to add support for other methods and an explicit writer method to flush.