compress
def compress(data: Span[UInt8], quality: Int = Int(11), lgwin: Int = Int(22), mode: Int = Int(0)) -> List[UInt8] Compress data into a single Brotli stream.
Zero-length data is a real (if degenerate) case: Brotli emits a valid
one-byte stream that decodes back to nothing.
- Args
data: Bytes to compress.quality: 0..11; higher is slower and smaller. 11 is libbrotli's own default and is very slow on large inputs — 4 or 5 is the usual choice for Parquet pages.lgwin: Sliding-window size in bits, 10..24 (22 = 4 MiB).mode:MODE_GENERIC,MODE_TEXT, orMODE_FONT— a hint that selects the encoder's context model.