Beispiel #1
0
func (object *OdbObject) Data() (data []byte) {
	var c_blob unsafe.Pointer = C.git_odb_object_data(object.ptr)
	var blob []byte

	len := int(C.git_odb_object_size(object.ptr))

	sliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&blob)))
	sliceHeader.Cap = len
	sliceHeader.Len = len
	sliceHeader.Data = uintptr(c_blob)

	return blob
}
Beispiel #2
0
func (obj *OdbObject) Size() int {
	return int(C.git_odb_object_size(obj.git_odb_object))
}
Beispiel #3
0
func (object *OdbObject) Len() (len uint64) {
	return uint64(C.git_odb_object_size(object.ptr))
}
Beispiel #4
0
func (obj *OdbObject) Data() []byte {
	data := C.git_odb_object_data(obj.git_odb_object)
	length := C.git_odb_object_size(obj.git_odb_object)
	return C.GoBytes(data, C.int(length))
}