code: func (f *Buffer) Read(b []byte) (n int, err error) {
  	if f.isClosed {
  		return 0, io.EOF
  	}
  	if len(b) == 0 {
  		return 0, nil
  	}
  	if f.Index >= int64(f.Buff.Len()) {
  		return 0, io.EOF
  	}
  	n, err = bytes.NewBuffer(f.Buff.Bytes()[f.Index:]).Read(b)
  	f.Index += int64(n)
  
  	return n, err
  }
docs: // Read implements io.Reader https://golang.org/pkg/io/#Reader
  // Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p))
  // and any error encountered. Even if Read returns n < len(p), it may use all of p as scratch
  // space during the call. If some data is available but not len(p) bytes, Read conventionally
  // returns what is available instead of waiting for more.
  // When Read encounters an error or end-of-file condition after successfully reading n > 0 bytes,
  // it returns the number of bytes read. It may return the (non-nil) error from the same call or
  // return the error (and n == 0) from a subsequent call. An instance of this general case is
  // that a Reader returning a non-zero number of bytes at the end of the input stream may return
  // either err == EOF or err == nil. The next Read should return 0, EOF.