code: func (bp *BytesPipe) Read(p []byte) (n int, err error) {
  	bp.mu.Lock()
  	if bp.bufLen == 0 {
  		if bp.closeErr != nil {
  			bp.mu.Unlock()
  			return 0, bp.closeErr
  		}
  		bp.wait.Wait()
  		if bp.bufLen == 0 && bp.closeErr != nil {
  			err := bp.closeErr
  			bp.mu.Unlock()
  			return 0, err
  		}
  	}
  
  	for bp.bufLen > 0 {
  		b := bp.buf[0]
  		read, _ := b.Read(p) // ignore error since fixedBuffer doesn't really return an error
  		n += read
  		bp.bufLen -= read
  
  		if b.Len() == 0 {
  			// it's empty so return it to the pool and move to the next one
  			returnBuffer(b)
  			bp.buf[0] = nil
  			bp.buf = bp.buf[1:]
  		}
  
  		if len(p) == read {
  			break
  		}
  
  		p = p[read:]
  	}
  
  	bp.wait.Broadcast()
  	bp.mu.Unlock()
  	return
  }
docs: // Read reads bytes from BytesPipe.
  // Data could be read only once.