code: func (w *ByteWriter) WriteVal(val interface{}, offset int) (int, error) {
  	if s, isString := val.(string); isString {
  		return w.WriteString(s, offset)
  	}
  
  	buf := bytes.NewBuffer(make([]byte, 0))
  
  	err := binary.Write(buf, byteOrder, val)
  	if err != nil {
  		return 0, err
  	}
  
  	return w.Write(buf.Bytes(), offset)
  }
docs: // WriteVal writes an arbitrary value to the buffer