コード例 #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)))
}