MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / offset

Method offset

src/main/java/core/org/xbill/DNS/Name.java:94–109  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

92}
93
94private final int
95offset(int n) {
96 if (n == 0 && getlabels() == 0)
97 return 0;
98 if (n < 0 || n >= getlabels())
99 throw new IllegalArgumentException("label out of range");
100 if (n < MAXOFFSETS) {
101 int shift = 8 * (7 - n);
102 return ((int)(offsets >>> shift) & 0xFF);
103 } else {
104 int pos = offset(MAXOFFSETS - 1);
105 for (int i = MAXOFFSETS - 1; i < n; i++)
106 pos += (name[pos] + 1);
107 return (pos);
108 }
109}
110
111private final void
112setlabels(int labels) {

Callers 15

appendMethod · 0.95
relativizeMethod · 0.95
wildMethod · 0.95
canonicalizeMethod · 0.95
fromDNAMEMethod · 0.95
isAbsoluteMethod · 0.95
lengthMethod · 0.95
subdomainMethod · 0.95
toStringMethod · 0.95
getLabelMethod · 0.95
getLabelStringMethod · 0.95
toWireMethod · 0.95

Calls 1

getlabelsMethod · 0.95

Tested by

no test coverage detected