-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZlibEncoder doesn't report correct compressed size #246
Comments
Thanks for the report! Is this an issue with all the backends? Or just one? If so it may be a bug for that specific backend. |
The bug is reproducible on all 4 backends. |
Hm ok if this reproduces everywhere it may be best to just update the documentation to indicate it doesn't include the 6-byte header. |
This means there's an asymmetry between Personally, I would prefer this to be fixed, but I don't really know what this entails for the implementation, and as long as the current behavior is correctly documented I can live with it. |
That's true yeah, if all the backends behave consistently we can work around that in each implementation. Seems reasonable to fix then! |
Note: I just found out that my explanation was slightly wrong, as the ZLIB header is only 2 bytes, not 6. The 6 extra bytes actually correspond to:
|
There zlib wrapper can have further 4 bytes of checksum following the header at the start of the stream if FDICT is used (which is only available with the zlib back-end currently.). |
The following snippet:
Prints:
The 6 missing bytes correspond to the ZLIB header;
ZlibEncoder
doesn't take into account its size and only returns the size of the wrapped deflate stream.If this is the intended behavior, I think it should be clarified in the
total_out()
documentation, because this is very unintuitive and unexpected.The text was updated successfully, but these errors were encountered: