Example #1
0
func CompressHC(in, out []byte) int {
	n := C.LZ4_compressHC((*C.char)(unsafe.Pointer(&in[0])), (*C.char)(unsafe.Pointer(&out[0])), C.int(len(in)))
	return (int)(n)
}
Example #2
0
/*
return : the number of bytes in compressed buffer dest
note : destination buffer must be already allocated.

To avoid any problem, size it to handle worst cases situations (input data not compressible)
Worst case size evaluation is provided by function CompressBound()
*/
func CompressHighCompression(source, dest []byte, isize int) int {
	return int(C.LZ4_compressHC(cast(source), cast(dest), C.int(isize)))
}