code: func (h *DBHeader) writeTo(w io.Writer) error {
  	var buffer bytes.Buffer
  	mw := io.MultiWriter(w, &buffer)
  
  	binary.Write(mw, binary.LittleEndian, h.Signature)
  
  	if h.IsKdbx4() {
  		h.FileHeaders.writeTo4(mw, &buffer)
  	} else {
  		h.FileHeaders.writeTo31(mw)
  	}
  
  	h.RawData = buffer.Bytes()
  
  	return nil
  }
docs: // writeTo writes the header to the given io.Writer