예제 #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)))
}