support standard brotli compression/decompression (.br format compressible with single-threaded brotli) #351
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements support for standard brotli compression/decompression without 7z container, header and framing (
.br
format compressible with single-threaded brotli API or command line tool).Usage examples for 7z command line:
Because brotli handler also uses BrotliEncoder/BrotliDecoder but they using brotli-mt in 7z format, also with
-mmt=1
, to compress/decompress single-threaded brotli format the handler usesthreads=0
internally. This is artificial value and signals that standard brotli compression format (without headers and mt-frames according to RFC 7932) must be used.However by decompression one could read the header and check whether
BROTLIMT_MAGIC_SKIPPABLE
is available, just brotli format is complex and it doesn't really has a header prefix, so one can't exclude that at some point some compressed file or stream wouldn't start with the same bits sequence equal toBROTLIMT_MAGIC_SKIPPABLE
.So at the moment only file extension (
.br
,.brotli
) or parameter-tbrotli
determine the type of brotli compression format.Additionally brotli encoder extended now to support supplying of
wlog
andlong
parameters, in 7z (-m0=brotli:long=n
) as well as in brotli format.Related to #21, #126