Documentation
¶
Index ¶
- func CompressAnyDefault(source, dest interface{}, sourceSize, maxDestSize int) (int, error)
- func CompressAnyFast(source, dest interface{}, sourceSize, maxDestSize, acceleration int) (int, error)
- func CompressBound(size int) int
- func CompressDefault(source, dest []byte) (int, error)
- func CompressFast(source, dest []byte, acceleration int) (int, error)
- func DecompressAnyFast(source, dest interface{}, originalSize int) (int, error)
- func DecompressAnySafe(source, dest interface{}, compressedSize, maxDecompressedSize int) (int, error)
- func DecompressFast(source, dest []byte, originalSize int) (int, error)
- func DecompressSafe(source, dest []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressAnyDefault ¶
CompressAnyDefault works the same as CompressDefault, but you can pass pointer of struct or slice as a buffer. Also, the size of buffer should be specified explicitly.
func CompressAnyFast ¶
func CompressAnyFast(source, dest interface{}, sourceSize, maxDestSize, acceleration int) (int, error)
CompressAnyFast works the same as CompressFast, but you can pass pointer of struct or slice as a buffer. Also, the size of buffer should be specified explicitly.
func CompressBound ¶
CompressBound returns the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible).
func CompressDefault ¶
CompressDefault compresses buffer "source" into already allocated "dest" buffer. Compression is guaranteed to succeed if size of "dest" >= CompressBound(size of "src") The function returns the number of bytes written into buffer "dest". If the function cannot compress "source" into a more limited "dest" budget, compression stops immediately, and the function result is zero.
func CompressFast ¶
CompressFast works the same as CompressDefault, but allows to select an "acceleration" factor. The larger the acceleration value, the faster the algorithm, but also the lesser the compression. An acceleration value of "1" is the same as regular CompressDefault()
func DecompressAnyFast ¶
DecompressAnyFast works the same as DecompressFast, but you can pass pointer of struct or slice as a buffer.
func DecompressAnySafe ¶
func DecompressAnySafe(source, dest interface{}, compressedSize, maxDecompressedSize int) (int, error)
DecompressAnySafe works the same as DecompressSafe, but you can pass pointer of struct or slice as a buffer. Also, the size of buffer should be specified explicitly.
func DecompressFast ¶
DecompressFast fully respect memory boundaries for properly formed compressed data. It is a bit faster than DecompressSafe. However, it does not provide any protection against intentionally modified data stream (malicious input).
func DecompressSafe ¶
DecompressSafe decompresses buffer "source" into already allocated "dest" buffer. The function returns the number of bytes written into buffer "dest". If destination buffer is not large enough, decoding will stop and output an error code (<0). If the source stream is detected malformed, the function will stop decoding and return a negative result.
Types ¶
This section is empty.