Documentation ¶
Overview ¶
Package lz4 implements compression using lz4.c and lz4hc.c
Copyright (c) 2013 CloudFlare, Inc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
Compress compresses in and puts the content in out. len(out) should have enough space for the compressed data (use CompressBound to calculate). Returns the number of bytes in the out slice.
func CompressBound ¶
CompressBound calculates the size of the output buffer needed by Compress. This is based on the following macro:
#define LZ4_COMPRESSBOUND(isize)
((unsigned int)(isize) > (unsigned int)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
func CompressHC ¶
CompressHC compresses in and puts the content in out. len(out) should have enough space for the compressed data (use CompressBound to calculate). Returns the number of bytes in the out slice. Determines the compression level automatically.
func CompressHCLevel ¶
CompressHCLevel compresses in at the given compression level and puts the content in out. len(out) should have enough space for the compressed data (use CompressBound to calculate). Returns the number of bytes in the out slice. To automatically choose the compression level, use 0. Otherwise, use any value in the inclusive range 1 (worst) through 16 (best). Most applications will prefer CompressHC.
func Uncompress ¶
Uncompress with a known output size. len(out) should be equal to the length of the uncompressed out.
Types ¶
This section is empty.