Пример #1
0
func (b *anyBio) Write(buf []byte) (written int, err error) {
	if len(buf) == 0 {
		return 0, nil
	}
	n := int(C.BIO_write((*C.BIO)(b), unsafe.Pointer(&buf[0]),
		C.int(len(buf))))
	if n != len(buf) {
		return n, errors.New("BIO write failed")
	}
	return n, nil
}
Пример #2
0
//See BIO_write
func (bio *BIO) Write(b []byte) int {
	C.clear_sys_error()
	return int(C.BIO_write(bio.BIO, unsafe.Pointer(&b[0]), C.int(len(b))))
}
Пример #3
0
//See BIO_write
func (self *BIO) Write(b []byte) int {
	C.clear_sys_error()
	ret := int(C.BIO_write(self.BIO, unsafe.Pointer(&b[0]), C.int(len(b))))
	return ret
}