Quim Rovira [Sun, 14 Aug 2016 09:38:41 +0000 (11:38 +0200)]
Add tests for compression, and a CLI tool for manual testing.
I changed the names of the tests, so that compress round-trip runs
after the uncompress tests.
Also added a cli tool that tries to follow the official /bro/ cli tool,
but it's use is mostly for validation and testing, and is still missing
support for many of the flags (eg. --repeat).
For this, I moved the File::Slurp module to an actual dependency, not
a tests-only dep.
Quim Rovira [Sun, 14 Aug 2016 09:31:10 +0000 (11:31 +0200)]
Initial brotli compressor bindings
This provides both one-shot and streaming support, but I haven't yet
tested this thoroughly in terms of leaks and performance. The code tries
to adhere as much as possible to the rest of the module conventions.
Quim Rovira [Sun, 14 Aug 2016 09:08:20 +0000 (11:08 +0200)]
Use a local temporary buffer for decompression instead of a global.
Allocating the temporary buffer on each call to decompress might be
slightly less efficient, but that would mostly impact streaming
decompression with very small blocks.
Not even sure this change is really worth doing.. it could use some
benchmarking to see if it really makes sense.
Quim Rovira [Sat, 13 Aug 2016 11:29:06 +0000 (13:29 +0200)]
Update use of deprecated brotli decoder APIs
This does not cover the use of BrotliDecompressedSize, and by looking at
the brotli code, it might even be a good idea to just use the streaming
interface right away.