Open hvr opened 8 years ago
Hmm, looking at zlib, considering the fact that it includes a copy of the library and then only exposes a only part of the functionality in a higher-level interface, wouldn't it make sense to also include a low-level interface that directly corresponds to C calls and that exposes most or all of the API?
With this change, I can create streams which always Z_SYNC_FLUSH
...
https://github.com/haskell/zlib/pull/10
At the API level this can be done by e.g. providing an additional field in
CompressInputRequired
(this is what e.g. https://github.com/hvr/lzma does):which then results in a
Z_SYNC_FLUSH
being requested fromzlib
, and resulting in theCompressOutputAvailable
state being returned until all input data has been flushed out as compressed data.Quoting the zlib documentation on
deflate(_ ,Z_SYNC_FLUSH)
:This would allow libraries such as
io-streams
to migrate fromzlib-bindings
tozlib