python-brotli has Compressor for streaming compression but nothing for
streaming decompression.
This is a straight-forward copy of the Compressor code into the new
class Decompressor.
This adds `flush` and `finish` methods to the `Compressor`
object in the extension module, renames the `compress` method to
`process`, and updates that method to only process data. Now,
one or more `process` calls followed by a `finish` call will be
equivalent to a module-level `compress` call.
Note: To maximize the compression efficiency (and match
underlying Brotli behavior, the `Compressor` object `process`
method does not guarantee all input is immediately written to
output. To ensure immediate output, call `flush` to manually
flush the compression buffer. Extraneous flushing can increase
the size, but may be required when processing streaming data.
Progress on #191
- Create a `Compressor` object in the extension module
- Move the `compress` method into the native module and use
the new `Compressor` object to do the compression
Note: This does not change the module-level Python API. The
`Compressor` object will not be publicly exposed until its
methods have stabilized.