code: func (w *Writer) Write(r *Record) error {
  	b, err := r.MarshalSAM(w.flags)
  	if err != nil {
  		return err
  	}
  	b = append(b, '\n')
  	_, err = w.w.Write(b)
  	return err
  }
docs: // Write writes r to the SAM stream.