null if level is 0 (store-only mode).lz4CompressBlockWithDict
private fn
ubyte[] lz4CompressBlockWithDict(const(ubyte)[] src, int level, const(ubyte)[] dict)Compress a single block of data using the LZ4 block format with dictionary.
This is the dictionary-aware version of lz4CompressBlock. When a dictionary is provided, it enables matches to reference data in the dictionary, improving compression for data similar to the dictionary.
The compression level controls both the hash table size and the matching strategy:
- Level 0: Store-only mode. Returns
nullto signal uncompressed block. - Levels 1-6: Greedy matching with dictionary support.
- Levels 7-9: HC (lazy) matching with dictionary support.
Parameters
srcInput bytes to compress. levelCompression level (0-9). Default is 1 for fast compression. dictOptional dictionary data (may be null or empty). Returns
Newly allocated array containing the LZ4-compressed block, orThrows
CompressionErrorwithErrorCode.INVALID_INPUTifsrc.lengthexceedsLZ4_MAX_INPUT_SIZE.