mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Decompress truncated files #240
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @espoal on GitHub (Jun 24, 2018).
Mine might be an edge case, but I need to decompress truncated files.
I'm testing http2 chunked responses, with precompressed files.
Currently, with gzip I calculate optimal truncation points by trial and error, trying several combinations until I find the best one.
With Brotli I can't do it from the command line and thus I can't automate it. From the browser it works, though.
reproduction:
brotli input.txt && truncate -s700 input.txt.br && brotli -d input.txt.br@eustas commented on GitHub (Jun 26, 2018):
Hello.
Could you elaborate, please? What are "optimal" truncation points?
Brotli decoder is built in a way to decode all the input bytes it has been provided so far. Every "flush" will add overhead, and is only useful for dynamic packaged networking, where it is important to give guarantees that all the encoded bytes will be decoded on the other size (i.e. nothing is "buffered")...
@eustas commented on GitHub (Oct 22, 2018):
You could use Python wrapper. It's API is close to C API, but allows quick experiments.