code: func newBuffer(br *Reader) (*buffer, error) {
  	n, err := io.ReadFull(br.r, br.buf[:4])
  	// br.r.Chunk() is only valid after the call the Read(), so this
  	// must come after the first read in the record.
  	tx := br.r.Begin()
  	defer func() {
  		br.lastChunk = tx.End()
  	}()
  	if err != nil {
  		return nil, err
  	}
  	if n != 4 {
  		return nil, errors.New("bam: invalid record: short block size")
  	}
  	b := &buffer{data: br.buf[:4]}
  	size := int(b.readInt32())
  	if size == 0 {
  		return nil, io.EOF
  	}
  	if size < 0 {
  		return nil, errors.New("bam: invalid record: invalid block size")
  	}
  	b.off, b.data = 0, make([]byte, size)
  	n, err = io.ReadFull(br.r, b.data)
  	if err != nil {
  		return nil, err
  	}
  	if n != size {
  		return nil, errors.New("bam: truncated record")
  	}
  	return b, nil
  }
docs: // newBuffer returns a new buffer reading from the Reader's underlying bgzf.Reader and
  // updates the Reader's lastChunk field.