pub fn compress_with_buffer(
data: &[u8],
algorithm: CompressionAlgorithm,
threshold: usize,
output: Vec<u8>,
) -> Result<Vec<u8>>Expand description
Compresses data using the specified algorithm with a provided output buffer. This version reuses the output buffer to reduce allocations in hot paths. Returns the compressed data, reusing the provided buffer when possible.