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

Method add

src/main/java/core/org/xbill/DNS/Compression.java:39–51  ·  view source on GitHub ↗

Adds a compression entry mapping a name to a position in a message. @param pos The position at which the name is added. @param name The name being added to the message.

(int pos, Name name)

Source from the content-addressed store, hash-verified

37 * @param name The name being added to the message.
38 */
39public void
40add(int pos, Name name) {
41 if (pos > MAX_POINTER)
42 return;
43 int row = (name.hashCode() & 0x7FFFFFFF) % TABLE_SIZE;
44 Entry entry = new Entry();
45 entry.name = name;
46 entry.pos = pos;
47 entry.next = table[row];
48 table[row] = entry;
49 if (verbose)
50 System.err.println("Adding " + name + " at " + pos);
51}
52
53/**
54 * Retrieves the position of the given name, if it has been previously

Callers

nothing calls this directly

Calls 1

hashCodeMethod · 0.45

Tested by

no test coverage detected