code: func (e *RecordEncoder) Samples(samples []RefSample, b []byte) []byte {
  	buf := encoding.Encbuf{B: b}
  	buf.PutByte(byte(RecordSamples))
  
  	if len(samples) == 0 {
  		return buf.Get()
  	}
  
  	// Store base timestamp and base reference number of first sample.
  	// All samples encode their timestamp and ref as delta to those.
  	first := samples[0]
  
  	buf.PutBE64(first.Ref)
  	buf.PutBE64int64(first.T)
  
  	for _, s := range samples {
  		buf.PutVarint64(int64(s.Ref) - int64(first.Ref))
  		buf.PutVarint64(s.T - first.T)
  		buf.PutBE64(math.Float64bits(s.V))
  	}
  	return buf.Get()
  }
docs: // Samples appends the encoded samples to b and returns the resulting slice.