private static void
mapToWire(DNSOutput out, TreeSet map, int mapbase) {
	int arraymax = (((Integer)map.last()).intValue()) & 0xFF;
	int arraylength = (arraymax / 8) + 1;
	int [] array = new int[arraylength];
	out.writeU8(mapbase);
	out.writeU8(arraylength);
	for (Iterator it = map.iterator(); it.hasNext(); ) {
		int typecode = ((Integer)it.next()).intValue();
		array[(typecode & 0xFF) / 8] |= (1 << ( 7 - typecode % 8));
	}
	for (int j = 0; j < arraylength; j++)
		out.writeU8(array[j]);
}
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