code: func PipelinedCopy(
  	dest io.Writer,
  	src io.Reader,
  	numBuffers int,
  	bufferSize int,
  	minRead int) (written int64, err error) {
  
  	if numBuffers < 1 {
  		return 0, errors.Newf("Invalid number of buffers: %d", numBuffers)
  	}
  
  	if bufferSize < 1 {
  		return 0, errors.Newf("Invalid buffer size: %d", bufferSize)
  	}
  
  	if minRead < 0 {
  		return 0, errors.Newf("Invalid min read size: %d", minRead)
  	}
  
  	if minRead > bufferSize {
  		return 0, errors.Newf(
  			"min read size cannot be bigger than buffer size: %d > %d",
  			minRead,
  			bufferSize)
  	}
  
  	if numBuffers == 1 {
  		// Nothing to pipeline.  Just use basic copy. (Don't use io.CopyBuffer
  		// for streaming requests since it always attempt to fill the entire
  		// buffer before forwarding).
  		buf := make([]byte, bufferSize, bufferSize)
  		return io.CopyBuffer(dest, src, buf)
  	}
  
  	copier := newCircularBufferCopier(
  		dest,
  		src,
  		numBuffers,
  		bufferSize,
  		minRead)
  	return copier.execute()
  }
docs: // This is similar to io.CopyBuffer, except this uses circular buffer and
  // goroutines to pipeline copying (When numBuffers is 1, this simply uses
  // io.CopyBuffer).
  //
  // PipelinedCopy copy will always fill a buffer until it has at least minRead
  // bytes in buffer before forwarding the buffer.
  // PipelinedCopy flushes dest after each write if it implements http.Flusher
  // interface.