Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LZ4Frame: Allow the user to inject data into the decompression stream #814

Open
terrelln opened this issue Nov 27, 2019 · 0 comments
Open

Comments

@terrelln
Copy link
Contributor

Imagine a protocol that disallows the compressor to inflate the packet size and we want to use LZ4Frame streaming compression.

Whenever we compress a packet, and it gets larger, we must send it uncompressed because of the protocol restrictions. We now need to reset the compressor and decompressor, since the decompressor will never receive the uncompressed block, and the compressor has already processed it (we just threw out the result).

We will still send the uncompressed data to the decompressor. It would be nice to have a function like LZ4F_injectUncompressedBlock(LZ4F_dctx* dctx, void const* src, size_t srcSize). That way we don't have to reset the stream.

Alternatively, the user could prepend a fake LZ4F block header to the uncompressed data, and pass that to the normal decompression function. This works with the current LZ4 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants