func (rs *ResourceSet) write(w io.Writer) ([]int, error) {
	s := rs.prepare()
	if err := rs.writeTypeDir(w, s); err != nil {
		return nil, err
	}
	if err := rs.writeResDirs(w, s); err != nil {
		return nil, err
	}
	if err := rs.writeLangDirs(w, s); err != nil {
		return nil, err
	}
	// names will be inserted between the last directory level (data index) and actual data
	s.offset += len(s.namesData) * 2
	if err := rs.writeDataIndex(w, s); err != nil {
		return nil, err
	}
	if err := binary.Write(w, binary.LittleEndian, s.namesData); err != nil {
		return nil, err
	}
	if err := rs.writeData(w, s); err != nil {
		return nil, err
	}
	return append([]int{}, s.relocAddr...), nil
}
// write writes the whole rsrc section's content: the directory and the actual data.
// It returns a slice of addresses for the relocation table.
// https://docs.microsoft.com/en-us/previous-versions/ms809762(v=msdn.10)#pe-file-resources
write writes the whole rsrc section's content: the directory and the actual data.
It returns a slice of addresses for the relocation table.
// write writes the whole rsrc section ' s content : the directory and the actual data . // It returns a slice of addresses for the relocation table . // https : // docs . microsoft . com / en - us / previous - versions / ms809762 ( v = msdn . 10 ) #pe - file - resources
func (rs *ResourceSet) write(w io.Writer) ([]int, error) {
	s := rs.prepare()
	if err := rs.writeTypeDir(w, s); err != nil {
		return nil, err
	}
	if err := rs.writeResDirs(w, s); err != nil {
		return nil, err
	}
	if err := rs.writeLangDirs(w, s); err != nil {
		return nil, err
	}
	s.offset += len(s.namesData) * 2
	if err := rs.writeDataIndex(w, s); err != nil {
		return nil, err
	}
	if err := binary.Write(w, binary.LittleEndian, s.namesData); err != nil {
		return nil, err
	}
	if err := rs.writeData(w, s); err != nil {
		return nil, err
	}
	return append([]int{}, s.relocAddr...), nil
}
func ( rs * ResourceSet ) write ( w io . Writer ) ( [ ] int , error ) { s := rs . prepare ( ) if err := rs . writeTypeDir ( w , s ) ; err != nil { return nil , err } if err := rs . writeResDirs ( w , s ) ; err != nil { return nil , err } if err := rs . writeLangDirs ( w , s ) ; err != nil { return nil , err } s . offset += len ( s . namesData ) * 2 if err := rs . writeDataIndex ( w , s ) ; err != nil { return nil , err } if err := binary . Write ( w , binary . LittleEndian , s . namesData ) ; err != nil { return nil , err } if err := rs . writeData ( w , s ) ; err != nil { return nil , err } return append ( [ ] int { } , s . relocAddr ... ) , nil }
write writes the whole rsrc section's content: the directory and the actual data.
write writes the whole rsrc section ' s content : the directory and the actual data .
// names will be inserted between the last directory level (data index) and actual data