LZ4_decompre...afe_continue(9)
πΈ NAME πΈ
LZ4_decompress_safe_continue β decompress blocks in streaming mode, bestie π
Oh and hey, quick vibe check β this whole page lives in the Kernel API Manual, so likeβ¦ kernel girlies, this one's for you π«Ά
β¨ SYNOPSIS β¨
int LZ4_decompress_safe_continue (LZ4_streamDecode_t *LZ4_streamDecode ,
const char *source , char *dest , int compressedSize , int
maxDecompressedSize );
π ARGUMENTS π
LZ4_streamDecodeβ theLZ4_streamDecode_tstructure, that's your little state bestie π«Άsourceβ source address of the compressed data, aka where the good stuff livesdestβ output buffer address of the uncompressed data, and heads up: it must be already allocated (not me forgetting to malloc, never π)compressedSizeβ the precise full size of the compressed block, like exactly exactlymaxDecompressedSizeβ the size of thedestbuffer
π¦ DESCRIPTION π¦
Okay so this decoding function lets you decompress multiple blocks in "streaming" mode β¨ And here's the thing β previously decoded blocks *must* remain available at the memory position where they were decoded (up to 64 KB). Like, do not move them, do not touch them, they live there now π
In the case of ring buffers, the decoding buffer must be either:
- Exactly same size as the encoding buffer, with the same update rule (block boundaries at same positions). In which case, the decoding & encoding ring buffer can have any size, including very small ones (
< 64 KB). Slay, tiny buffers π - Larger than the encoding buffer, by a minimum of
maxBlockSizemore bytes.maxBlockSizeis implementation dependent β it's the maximum size you intend to compress into a single block. In which case, encoding and decoding buffers do not need to be synchronized, and the encoding ring buffer can have any size, including small ones (< 64 KB) β¨ - At least
64 KB + 8 bytes + maxBlockSize. In which case, encoding and decoding buffers do not need to be synchronized, and the encoding ring buffer can have any size, including larger than the decoding buffer π
Whenever these conditions are not possible, save the last 64KB of decoded data into a safe buffer, and indicate where it is saved using LZ4_setStreamDecode β no cap, this is the fallback and it's not optional π¨
π₯ RETURN π₯
Number of bytes decompressed into the destination buffer (necessarily <= maxDecompressedSize) β or a negative result in case of error π
π SEE ALSO π
Kernel file ./include/linux/lz4.h plus the whole friend group:
LZ4_compressBound(9), LZ4_compress_default(9), LZ4_compress_fast(9), LZ4_compress_destSize(9), LZ4_decompress_fast(9), LZ4_decompress_safe(9), LZ4_decompress_safe_partial(9), LZ4_compress_HC(9), LZ4_resetStreamHC(9), LZ4_loadDictHC(9), LZ4_compress_HC_continue(9), LZ4_saveDictHC(9), LZ4_resetStream(9), LZ4_loadDict(9), LZ4_saveDict(9), LZ4_compress_fast_continue(9), LZ4_setStreamDecode(9), LZ4_decompress_fast_continue(9), LZ4_decompress_safe_usingDict(9), LZ4_decompress_fast_usingDict(9)
Okay that's the whole page, mwah π This cutie came from ./include/linux, dated October 2026, and it's filed under LZ4_decompre...afe_continue(9) β go forth and decompress responsibly, bestie ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms