Documentation
¶
Index ¶
Constants ¶
const ( // BestSpeed provides speed over better compression. BestSpeed = 3 // BestCompression provides better compression over speed. BestCompression = 9 )
Variables ¶
var ( InputUnderrun = errors.New("input underrun") LookBehindUnderrun = errors.New("lookbehind underrun") )
Functions ¶
func Compress1X ¶
Compress an input buffer with LZO1X
func Compress1X999 ¶
func Compress1X999Level ¶
func Decompress1X ¶
Decompress an input compressed with LZO1X.
LZO1X has a stream terminator marker, so the decompression will always stop when this marker is found.
If inLen is not zero, it is expected to match the length of the compressed input stream, and it is used to limit reads from the underlying reader; if inLen is smaller than the real stream, the decompression will abort with an error; if inLen is larger than the real stream, or if it is zero, the decompression will succeed but more bytes than necessary might be read from the underlying reader. If the reader returns EOF before the termination marker is found, the decompression aborts and EOF is returned.
outLen is optional; if it's not zero, it is used as a hint to preallocate the output buffer to increase performance of the decompression.
Types ¶
type Header ¶
Header metadata about the compressed file. This header is exposed as the fields of the Writer and Reader structs.
type Reader ¶
type Reader struct { Header // contains filtered or unexported fields }
A Reader is an io.Reader that can be read to retrieve uncompressed data from a lzop-format compressed file.
type Writer ¶
type Writer struct { Header // contains filtered or unexported fields }
A Writer is an io.Write that satisfies writes by compressing data written to its wrapped io.Writer.
func NewWriter ¶
NewWriter creates a new Writer that satisfies writes by compressing data written to w.
func NewWriterLevel ¶
NewWriterLevel is like NewWriter but specifies the compression level instead of assuming DefaultCompression.