Skip to content

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

@terrelln

Description

@terrelln

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions