pub fn decode<'a>(
codec: PayloadCodec,
stored: &'a [u8],
raw_byte_len: u64,
) -> Result<Cow<'a, [u8]>, CodecError>Expand description
Decode stored chunk bytes to uncompressed payload (raw_byte_len bytes).
Raw โ Cow::Borrowed; zstd โ owned. For raw, stored.len() must equal
raw_byte_len.
The Cow return avoids allocating for memory-mapped raw chunks while
preserving one API for compressed and uncompressed payloads.
ยงErrors
Returns CodecError on length mismatch or zstd failure.