public void
toWire(DNSOutput out) {
	if (types.size() == 0)
		return;

	int mapbase = -1;
	TreeSet map = new TreeSet();

	for (Iterator it = types.iterator(); it.hasNext(); ) {
		int t = ((Integer)it.next()).intValue();
		int base = t >> 8;
		if (base != mapbase) {
			if (map.size() > 0) {
				mapToWire(out, map, mapbase);
				map.clear();
			}
			mapbase = base;
		}
			map.add(t);
	}
	mapToWire(out, map, mapbase);
}
Routines for deal with the lists of types found in NSEC/NSEC3 records.

@author Brian Wellington
src/main/java/core/org/xbill/DNS/TypeBitmap.java