-
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
Provide something like len() for GzEncoder and GzDecoder #170
Comments
Thanks for the report! I don't think this is something that can be implemented though? Deflate streams don't know how big they're going to become, such information would have to be sent through a different channel alongside the stream to learn that |
If you mean the amount of bytes extracted so far, the underlying encoder does know. The counter may be 32-bit though. It's used when decompressing gzip-wrapped streams as they have a 32-bit length check value at the end. It's not available from the read/write structs though. Knowing the extracted length before extracting everything is not really possible though. |
Yes think of the last 4 bytes. I've implemented this for me to get the value and do some proof. I thought it would be nice to have this in-build in flate2.
|
Oh hm so you're looking to learn the size of the stream that was inflated after decompression has finished entirely? I think we could certainly add a method for that if one hasn't been added already! |
Hi,
would be nice to know the size of the extracted data, although there is an overflow after 4GB.
Or is it available and have not found it?!
Thanks
The text was updated successfully, but these errors were encountered: