mirror of
https://github.com/google/brotli.git
synced 2026-09-22 06:35:52 +00:00
There is no good way to estimate the size of out when decompressing #103
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 @mshneer on GitHub (Mar 25, 2016).
I am using BrotliDecompressBufferStreaming which does not provide a way to determine required size for output buffer. For large outputs, I am receiving BROTLI_RESULT_NEEDS_MORE_OUTPUT and the only solution I could work so far is to blindly increase the size of the output buffer and retry.
Possible ways to address these shortcomings.
@danielrh commented on GitHub (Apr 18, 2016):
I generally encode the output size in a header on my branch here
https://github.com/danielrh/brotli/tree/header
it's also good to have a magic number and the commit ID of the binary that encoded it
@eustas commented on GitHub (Apr 29, 2016):
There is BrotliDecompressedSize method.
Unfortunately, it works only is stream contains only one block. But it is the most frequent case.
We plan to add framing format in future, but currently you need to attach your own header, as Daniel said.