RunlengthEncoder
BinaryRunlengthEncoder(trim=Trim.trailing)
Bases: _RunlengthEncoder
Runlength encoder for binary data.
| PARAMETER | DESCRIPTION |
|---|---|
trim
|
Specifies whether leading and/or trailing skips should be omitted. |
add(byte)
Add a byte to the encoder.
| PARAMETER | DESCRIPTION |
|---|---|
byte
|
Byte to add.
TYPE:
|
add_bytes(data)
Add multiple bytes to the encoder.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Bytes to add.
TYPE:
|
end()
Finish encoding and return the compressed data.
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
Compressed data as bytes. |
skip(amount)
Skip the specified number of elements.
| PARAMETER | DESCRIPTION |
|---|---|
amount
|
Number of elements to skip.
TYPE:
|
SymbolRunlengthEncoder(trim=Trim.trailing)
Bases: _RunlengthEncoder
Runlength encoder for symbolic data.
| PARAMETER | DESCRIPTION |
|---|---|
trim
|
Specifies whether leading and/or trailing skips should be omitted. |
add(symbol)
Add a symbol to the encoder.
| PARAMETER | DESCRIPTION |
|---|---|
symbol
|
Symbol to add.
TYPE:
|
add_list(symbols)
Add multiple symbols to the encoder.
| PARAMETER | DESCRIPTION |
|---|---|
symbols
|
Symbols to add.
TYPE:
|
end()
Finish encoding and return the compressed data.
| RETURNS | DESCRIPTION |
|---|---|
list
|
Compressed data as a list. |
skip(amount)
Skip the specified number of elements.
| PARAMETER | DESCRIPTION |
|---|---|
amount
|
Number of elements to skip.
TYPE:
|
Trim
Bases: Enum
Specifies whether leading and/or trailing skips should be omitted.
both
class-attribute
instance-attribute
Omit both leading and trailing skips.
leading
class-attribute
instance-attribute
Omit leading skips.
none
class-attribute
instance-attribute
Do not omit skips.
trailing
class-attribute
instance-attribute
Omit trailing skips.