private int
sectionToWire(DNSOutput out, int section, Compression c,
	      int maxLength)
{
	int n = sections[section].size();
	int pos = out.current();
	int rendered = 0;
	int skipped = 0;
	Record lastrec = null;

	for (int i = 0; i < n; i++) {
		Record rec = (Record)sections[section].get(i);
		if (section == Section.ADDITIONAL && rec instanceof OPTRecord) {
			skipped++;
			continue;
		}

		if (lastrec != null && !sameSet(rec, lastrec)) {
			pos = out.current();
			rendered = i;
		}
		lastrec = rec;
		rec.toWire(out, section, c);
		if (out.current() > maxLength) {
			out.jump(pos);
			return n - rendered + skipped;
		}
	}
	return skipped;
}
Returns an array containing all records in the given section grouped into
RRsets.
@see RRset
@see Section
src/main/java/core/org/xbill/DNS/Message.java