func (te *TypeEntry) write(w io.Writer, s *state) error {
	if err := writeDirectoryTable(w, te.NamesCount, len(te.OrderedKeys)-te.NamesCount); err != nil {
		return err
	}
	for _, ident := range te.OrderedKeys[:te.NamesCount] {
		if err := writeDirectoryEntry(w, s.nameOffset[ident.(Name)], s.offset, true, true); err != nil {
			return err
		}
		s.offset += te.Resources[ident].size()
	}
	for _, ident := range te.OrderedKeys[te.NamesCount:] {
		if err := writeDirectoryEntry(w, int(ident.(ID)), s.offset, false, true); err != nil {
			return err
		}
		s.offset += te.Resources[ident].size()
	}
	return nil
}
// write writes the entry's directory table
write writes the entry's directory table
// write writes the entry ' s directory table
func (te *TypeEntry) write(w io.Writer, s *state) error {
	if err := writeDirectoryTable(w, te.NamesCount, len(te.OrderedKeys)-te.NamesCount); err != nil {
		return err
	}
	for _, ident := range te.OrderedKeys[:te.NamesCount] {
		if err := writeDirectoryEntry(w, s.nameOffset[ident.(Name)], s.offset, true, true); err != nil {
			return err
		}
		s.offset += te.Resources[ident].size()
	}
	for _, ident := range te.OrderedKeys[te.NamesCount:] {
		if err := writeDirectoryEntry(w, int(ident.(ID)), s.offset, false, true); err != nil {
			return err
		}
		s.offset += te.Resources[ident].size()
	}
	return nil
}
func ( te * TypeEntry ) write ( w io . Writer , s * state ) error { if err := writeDirectoryTable ( w , te . NamesCount , len ( te . OrderedKeys ) - te . NamesCount ) ; err != nil { return err } for _ , ident := range te . OrderedKeys [ : te . NamesCount ] { if err := writeDirectoryEntry ( w , s . nameOffset [ ident . ( Name ) ] , s . offset , true , true ) ; err != nil { return err } s . offset += te . Resources [ ident ] . size ( ) } for _ , ident := range te . OrderedKeys [ te . NamesCount : ] { if err := writeDirectoryEntry ( w , int ( ident . ( ID ) ) , s . offset , false , true ) ; err != nil { return err } s . offset += te . Resources [ ident ] . size ( ) } return nil }
write writes the entry's directory table
write writes the entry ' s directory table