cramjam.snappy
snappy de/compression interface
Snappy decompression.
Python Example
>>> # bytes or bytearray; bytearray is faster
>>> cramjam.snappy.decompress(compressed_bytes, output_len=Optional[None])
Snappy compression.
Python Example
>>> _ = cramjam.snappy.compress(b'some bytes here')
>>> _ = cramjam.snappy.compress(bytearray(b'this avoids double allocation in rust side, and thus faster!')) # <- use bytearray where possible
Snappy decompression, raw This does not use the snappy 'framed' encoding of compressed bytes.
Python Example
>>> cramjam.snappy.decompress_raw(compressed_raw_bytes)
Snappy compression raw. This does not use the snappy 'framed' encoding of compressed bytes.
Python Example
>>> cramjam.snappy.compress_raw(b'some bytes here')
Compress directly into an output buffer
Decompress directly into an output buffer
Compress raw format directly into an output buffer
Decompress raw format directly into an output buffer
Get the expected max compressed length for snappy raw compression; this is the size
of buffer that should be passed to compress_raw_into
Get the decompressed length for the given data. This is the size of buffer
that should be passed to decompress_raw_into
Snappy Compressor object for streaming compression
Decompressor object for streaming decompression
NB This is mostly here for API complement to Compressor
You'll almost always be statisfied with de/compress
/ de/compress_into
functions.