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

Method sectionToString

src/main/java/core/org/xbill/DNS/Message.java:563–583  ·  view source on GitHub ↗

Converts the given section of the Message to a String. @see Section

(int i)

Source from the content-addressed store, hash-verified

561 * @see Section
562 */
563public String
564sectionToString(int i) {
565 if (i > 3)
566 return null;
567
568 StringBuffer sb = new StringBuffer();
569
570 Record [] records = getSectionArray(i);
571 for (int j = 0; j < records.length; j++) {
572 Record rec = records[j];
573 if (i == Section.QUESTION) {
574 sb.append(";;\t" + rec.name);
575 sb.append(", type = " + Type.string(rec.type));
576 sb.append(", class = " + DClass.string(rec.dclass));
577 }
578 else
579 sb.append(rec);
580 sb.append("\n");
581 }
582 return sb.toString();
583}
584
585/**
586 * Converts the Message to a String.

Callers 1

toStringMethod · 0.95

Calls 5

getSectionArrayMethod · 0.95
stringMethod · 0.95
stringMethod · 0.95
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected