// Read reads the next len(p) bytes from R or until R is drained. The
// return value n is the number of bytes read. If R has no data to
// return, err is io.EOF and OnEOF is called with a full copy of what
// has been read so far.
Read reads the next len(p) bytes from R or until R is drained. The
return value n is the number of bytes read. If R has no data to
return, err is io.EOF and OnEOF is called with a full copy of what
has been read so far.
// Read reads the next len ( p ) bytes from R or until R is drained . The // return value n is the number of bytes read . If R has no data to // return err is io . EOF and OnEOF is called with a full copy of what // has been read so far .
func (r *cachingReadCloser) Read(p []byte) (n int, err error) {
	n, err = r.R.Read(p)
	r.buf.Write(p[:n])
	if err == io.EOF {
		r.OnEOF(bytes.NewReader(r.buf.Bytes()))
	}
	return n, err
}
func ( r * cachingReadCloser ) Read ( p [ ] byte ) ( n int , err error ) { n , err = r . R . Read ( p ) r . buf . Write ( p [ : n ] ) if err == io . EOF { r . OnEOF ( bytes . NewReader ( r . buf . Bytes ( ) ) ) } return n , err }
Read reads the next len(p) bytes from R or until R is drained.
Read reads the next len ( p ) bytes from R or until R is drained .