private final int
offset(int n) {
	if (n == 0 && getlabels() == 0)
		return 0;
	if (n < 0 || n >= getlabels())
		throw new IllegalArgumentException("label out of range");
	if (n < MAXOFFSETS) {
		int shift = 8 * (7 - n);
		return ((int)(offsets >>> shift) & 0xFF);
	} else {
		int pos = offset(MAXOFFSETS - 1);
		for (int i = MAXOFFSETS - 1; i < n; i++)
			pos += (name[pos] + 1);
		return (pos);
	}
}
The maximum number of cached offsets
src/main/java/core/org/xbill/DNS/Name.java