Documentation
¶
Overview ¶
Package lzo is a direct implementation of the LZO decompression algorithm in Go using the following sources as references:
- https://docs.kernel.org/staging/lzo.html (linux kernel documentation)
- https://github.com/AxioDL/lzokay/blob/db2df1fcbebc2ed06c10f727f72567d40f06a2be/lzokay.cpp (lzokay C++ implementation, MIT licensed)
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLookbehindOverrun = errors.New("lzo: lookbehind overrun") ErrOutputOverrun = errors.New("lzo: output overrun") ErrInputOverrun = errors.New("lzo: input overrun") ErrDecompressionFailed = errors.New("lzo: error during decompression") ErrInputNotConsumed = errors.New("lzo: input not fully consumed") )
Functions ¶
func Decompress ¶
Decompress the given LZO1X compressed data to the destination buffer.
Here's a summary of the state machine:
Instruction Bits Description -------------- ------------ ------------------------------------------------- M1 (short) 0x00..0x0F copy 2-3 bytes based on previous literal state M1 (long) 0x00..0x0F when state==0, long literal run (>=4 bytes) M2 0x40..0xFF copy 3-8 bytes within 2kB distance M3 0x20..0x3F copy small block within 16kB distance M4 0x10..0x1F copy block within 16..48kB, end-of-stream if distance==16384
Types ¶
Click to show internal directories.
Click to hide internal directories.