Reference#
Rust crate documentation is at docs.rs. For development versions, the documentation is here.
LZOCompressor #
Object containing the compressor state.
Reusing a single instance of this class reuses compressor-memory, reducing allocations.
Thread safety
Instance and static methods are thread-safe.
Source code in python/lzallright/_lzallright.pyi
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
compress #
compress(data)
Compresses data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes
|
Any python object that implements the buffer protocol |
required |
Note
The GIL (Global Interpreter Lock) is released for the duration of this function.
Source code in python/lzallright/_lzallright.pyi
13 14 15 16 17 18 19 20 21 22 | |
decompress
staticmethod
#
decompress(data, output_size_hint=None)
Decompresses data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes
|
Any python object that implements the buffer protocol |
required |
output_size_hint
|
int | None
|
Preallocate output buffer to this size. Helps reducing memory overhead if decompressed size is known in advance. |
None
|
Note
The GIL (Global Interpreter Lock) is released for the duration of this function.
Source code in python/lzallright/_lzallright.pyi
23 24 25 26 27 28 29 30 31 32 33 34 35 | |
EResult #
Error codes in LZOError.args[0].
Source code in python/lzallright/_lzallright.pyi
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
OutputOverrun
class-attribute
instance-attribute
#
OutputOverrun = ...
Buffer is not long enough to hold output.
Warning
lzallright always tries to find the appropriate buffer size. If you see this, it is an error.
InputOverrun
class-attribute
instance-attribute
#
InputOverrun = ...
Input to decompress is truncated
LZOError #
Bases: Exception
Fatal error during compression/decompression.
Source code in python/lzallright/_lzallright.pyi
56 57 58 59 60 61 62 | |
InputNotConsumed #
Bases: LZOError
Decompression finished with leftover data.
Source code in python/lzallright/_lzallright.pyi
64 65 66 67 68 69 70 71 | |
args
instance-attribute
#
args
Error reason, with decompressed data
(EResult.InputNotConsumed, decompressed: bytes)