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.
Adds
Compressor
object for all variants allowing for streaming compression.Mimicks the API of
brotli.Compressor
except it will return the number of bytes written instead ofb''
ie
Brought to my attention in developmentseed/starlette-cramjam#1
I'm not convinced that a
Decompressor
would be needed. In brotli,brotli.Decompressor().decompress()
behaves exactly the same asbrotli.decompress
. And I suppose most (all?) algorithms cannot decompress some arbitrary amount of bytes from a previously encoded stream. And in python-snappy, thesnappy.stream_decompress
seems to perform basically whatdecompress_into
does; a compressed input into another decompressed output.TODO:
IdeallyBytesType
as the output type, but think the lifetime parameter won't work well with#[pyclass]
. And unlikely able to change that sinceBytesType
can (and should) be able to reference Python owned types likebytes
/bytearray
/etc.BytesType
; will try more later.finish()
methods in Rust. However, not all encoders follow the same API, so a few are slightly different.