Reference#
LZOCompressor #
Object containing the compressor state.
Thread safety
It is not allowed to pass instances of this class between threads.
Source code in python/lzallright/_lzallright.pyi
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 36 37 38 39 40 41 42 43 44 |
|
compress #
compress(data)
Compresses data.
Subsequent invocations of this method reuses the compression state. In other words, the total output size doesn't change if you call this method using one big buffer or multiple small ones.
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
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
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 |
Optional[int]
|
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
32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
EResult #
Error codes in LZOError.args[0]
.
Source code in python/lzallright/_lzallright.pyi
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
OutputOverrun
instance-attribute
class-attribute
#
OutputOverrun = Ellipsis
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
instance-attribute
class-attribute
#
InputOverrun = Ellipsis
Input to decompress is truncated
InputNotConsumed
instance-attribute
class-attribute
#
InputNotConsumed = Ellipsis
See InputNotConsumed
LZOError #
Bases: Exception
Fatal error during compression/decompression.
Source code in python/lzallright/_lzallright.pyi
65 66 67 68 69 70 71 |
|
InputNotConsumed #
Bases: LZOError
Decompression finished with leftover data.
Source code in python/lzallright/_lzallright.pyi
73 74 75 76 77 78 79 80 |
|
args
instance-attribute
#
args: Tuple[EResult, bytes]
Error reason, with decompressed data
(EResult.InputNotConsumed, decompressed: bytes)