func (rs *ResourceSet) writeTypeDir(w io.Writer, s *state) error {
	if err := writeDirectoryTable(w, s.namesCount, len(s.orderedKeys)-s.namesCount); err != nil {
		return err
	}
	s.offset += sizeOfDirTable + len(s.orderedKeys)*sizeOfDirEntry
	for _, ident := range s.orderedKeys[:s.namesCount] {
		if err := writeDirectoryEntry(w, s.nameOffset[ident.(Name)], s.offset, true, true); err != nil {
			return err
		}
		s.offset += rs.Types[ident].size()
	}
	for _, ident := range s.orderedKeys[s.namesCount:] {
		if err := writeDirectoryEntry(w, int(ident.(ID)), s.offset, false, true); err != nil {
			return err
		}
		s.offset += rs.Types[ident].size()
	}
	return nil
}
// writeTypeDir is where we write the resource type directory (1st level: type)
writeTypeDir is where we write the resource type directory (1st level: type)
// writeTypeDir is where we write the resource type directory ( 1st level : type )
func (rs *ResourceSet) writeTypeDir(w io.Writer, s *state) error {
	if err := writeDirectoryTable(w, s.namesCount, len(s.orderedKeys)-s.namesCount); err != nil {
		return err
	}
	s.offset += sizeOfDirTable + len(s.orderedKeys)*sizeOfDirEntry
	for _, ident := range s.orderedKeys[:s.namesCount] {
		if err := writeDirectoryEntry(w, s.nameOffset[ident.(Name)], s.offset, true, true); err != nil {
			return err
		}
		s.offset += rs.Types[ident].size()
	}
	for _, ident := range s.orderedKeys[s.namesCount:] {
		if err := writeDirectoryEntry(w, int(ident.(ID)), s.offset, false, true); err != nil {
			return err
		}
		s.offset += rs.Types[ident].size()
	}
	return nil
}
func ( rs * ResourceSet ) writeTypeDir ( w io . Writer , s * state ) error { if err := writeDirectoryTable ( w , s . namesCount , len ( s . orderedKeys ) - s . namesCount ) ; err != nil { return err } s . offset += sizeOfDirTable + len ( s . orderedKeys ) * sizeOfDirEntry for _ , ident := range s . orderedKeys [ : s . namesCount ] { if err := writeDirectoryEntry ( w , s . nameOffset [ ident . ( Name ) ] , s . offset , true , true ) ; err != nil { return err } s . offset += rs . Types [ ident ] . size ( ) } for _ , ident := range s . orderedKeys [ s . namesCount : ] { if err := writeDirectoryEntry ( w , int ( ident . ( ID ) ) , s . offset , false , true ) ; err != nil { return err } s . offset += rs . Types [ ident ] . size ( ) } return nil }
writeTypeDir is where we write the resource type directory (1st level: type)
writeTypeDir is where we write the resource type directory ( 1st level : type )