func (a *AIO) Write(p []byte) (nn int, err error) {
	for len(p) > a.Available() && a.haserror() == nil {
		n := copy(a.buf[a.n:], p)
		a.n += n
		a.flush()
		nn += n
		p = p[n:]
	}
	if e := a.haserror(); e != nil {
		return nn, e
	}
	n := copy(a.buf[a.n:], p)
	a.n += n
	nn += n
	return nn, nil
}
// Write writes the contents of p into the buffer.
// It returns the number of bytes written.
// If nn < len(p), it also returns an error explaining
// why the write is short.
Write writes the contents of p into the buffer.
It returns the number of bytes written.
If nn < len(p), it also returns an error explaining
why the write is short.
// Write writes the contents of p into the buffer . // It returns the number of bytes written . // If nn < len ( p ) it also returns an error explaining // why the write is short .
func (a *AIO) Write(p []byte) (nn int, err error) {
	for len(p) > a.Available() && a.haserror() == nil {
		n := copy(a.buf[a.n:], p)
		a.n += n
		a.flush()
		nn += n
		p = p[n:]
	}
	if e := a.haserror(); e != nil {
		return nn, e
	}
	n := copy(a.buf[a.n:], p)
	a.n += n
	nn += n
	return nn, nil
}
func ( a * AIO ) Write ( p [ ] byte ) ( nn int , err error ) { for len ( p ) > a . Available ( ) && a . haserror ( ) == nil { n := copy ( a . buf [ a . n : ] , p ) a . n += n a . flush ( ) nn += n p = p [ n : ] } if e := a . haserror ( ) ; e != nil { return nn , e } n := copy ( a . buf [ a . n : ] , p ) a . n += n nn += n return nn , nil }
Write writes the contents of p into the buffer.
Write writes the contents of p into the buffer .