public void decode(ByteBuffer buffer) throws IOException { getCompression().clear(); _headerSection.decode(buffer); _questionSection.decode(buffer); _answerSection.decode(buffer, _headerSection.getAnswerRecords()); _authoritySection.decode(buffer, _headerSection.getAuthorityRecords()); _additionalSection.decode(buffer, _headerSection.getAdditionalRecords()); }
public void encode(ByteBuffer buffer) throws IOException { getCompression().clear(); _headerSection.encode(buffer); _questionSection.encode(buffer); _answerSection.encode(buffer); _authoritySection.encode(buffer); _additionalSection.encode(buffer); }
public String toString() { StringBuilder sb = new StringBuilder(); _headerSection.append(sb); _questionSection.append(sb); _answerSection.append(sb, "Answers"); _authoritySection.append(sb, "Authority name servers"); _additionalSection.append(sb, "Additional records"); return sb.toString(); }
public DnsMessage(Record record) { _headerSection.setId(__random.nextInt() & 0xFFFF); _headerSection.setOpCode(OpCode.QUERY); _questionSection.add(record); }