示例#1
0
文件: lz4.go 项目: avisagie/golz4
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)
}
示例#2
0
文件: lz4.go 项目: postfix/go-lz4
/*
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)))
}