dissect.util.compression.lz4#

Module Contents#

Functions#

decompress

LZ4 decompress from a file-like object up to a certain length. Assumes no header.

dissect.util.compression.lz4.decompress(src: bytes | BinaryIO, max_length: int = -1, return_bytearray: bool = False, return_bytes_read: bool = False) bytes | tuple[bytes, int]#

LZ4 decompress from a file-like object up to a certain length. Assumes no header.

Parameters:
  • src – File-like object to decompress from.

  • max_length – Decompress up to this many result bytes.

  • return_bytearray – Whether to return bytearray or bytes.

  • return_bytes_read – Whether to return a tuple of (data, bytes_read) or just the data.

Returns:

The decompressed data or a tuple of the decompressed data and the amount of bytes read.