mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
How to compress/decompress a small message with a shared dictionary? #526
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 @pkolaczk on GitHub (Oct 25, 2024).
I can see only the function
BrotliEncoderCompressStreamcan use a shared dictionary (need to attach it first), but one-shot compression/decompression functions likeBrotliEncoderCompressandBrotliDecoderDecompresscan't.What is the recommended way to compress/decompress a series of small (a few kB each), independent messages?
@eustas commented on GitHub (Nov 19, 2024):
BrotliEncoderCompressandBrotliDecoderDecompressin an API mistake, we don't recommend using them (except for simplest testing code).Recommended way to use streaming API. If dictionary does not change, it is recommended to prepare dictionary once and reuse prepared instance for encoding.