Example #1
0
func (rw *RWops) Read(data []byte) (int, error) {
	n := C.read(rw.c, unsafe.Pointer(&data[0]), 1, C.size_t(len(data)))
	switch {
	case n == 0:
		return 0, io.EOF
	case n < 0:
		return 0, getError()
	}

	return int(n), nil
}
Example #2
0
func (self *Mem) Read() string {
	return C.GoString(C.read())
}
Example #3
0
func ReadOnce() (uint16, uint8) {
	var a uint16
	i := C.read(0, unsafe.Pointer(&a), 1)
	return a, uint8(i)
}