code: func (d *RecordDecoder) Series(rec []byte, series []RefSeries) ([]RefSeries, error) {
  	dec := encoding.Decbuf{B: rec}
  
  	if RecordType(dec.Byte()) != RecordSeries {
  		return nil, errors.New("invalid record type")
  	}
  	for len(dec.B) > 0 && dec.Err() == nil {
  		ref := dec.Be64()
  
  		lset := make(labels.Labels, dec.Uvarint())
  
  		for i := range lset {
  			lset[i].Name = dec.UvarintStr()
  			lset[i].Value = dec.UvarintStr()
  		}
  		sort.Sort(lset)
  
  		series = append(series, RefSeries{
  			Ref:    ref,
  			Labels: lset,
  		})
  	}
  	if dec.Err() != nil {
  		return nil, dec.Err()
  	}
  	if len(dec.B) > 0 {
  		return nil, errors.Errorf("unexpected %d bytes left in entry", len(dec.B))
  	}
  	return series, nil
  }
docs: // Series appends series in rec to the given slice.