code: func (op *op) WriteTo(w io.Writer) (n int64, err error) {
  	buf := make([]byte, op.size())
  
  	// Write type and value.
  	buf[0] = byte(op.typ)
  	if op.typ <= 1 {
  		binary.LittleEndian.PutUint64(buf[1:9], op.value)
  	} else {
  		binary.LittleEndian.PutUint64(buf[1:9], uint64(len(op.values)))
  		p := 13 // start of values (skip 4 for checksum)
  		for _, v := range op.values {
  			binary.LittleEndian.PutUint64(buf[p:p+8], v)
  			p += 8
  		}
  	}
  
  	// Add checksum at the end.
  	h := fnv.New32a()
  	_, _ = h.Write(buf[0:9])
  	_, _ = h.Write(buf[13:])
  	binary.LittleEndian.PutUint32(buf[9:13], h.Sum32())
  
  	// Write to writer.
  	nn, err := w.Write(buf)
  	return int64(nn), err
  }
docs: // WriteTo writes op to the w.