testEncodePtr() — netty Function Reference
Architecture documentation for the testEncodePtr() function in DefaultDnsRecordEncoderTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD f7a06fe1_4a51_2b09_1837_b56c33c1f522["testEncodePtr()"] 47911929_f87d_8a18_283d_e24d57ce4e70["DefaultDnsRecordEncoderTest"] f7a06fe1_4a51_2b09_1837_b56c33c1f522 -->|defined in| 47911929_f87d_8a18_283d_e24d57ce4e70 style f7a06fe1_4a51_2b09_1837_b56c33c1f522 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-dns/src/test/java/io/netty/handler/codec/dns/DefaultDnsRecordEncoderTest.java lines 32–66
@Test
public void testEncodePtr() throws Exception {
DefaultDnsRecordEncoder encoder = new DefaultDnsRecordEncoder();
DnsPtrRecord ptrRecord = new DefaultDnsPtrRecord("131.186.250.142.in-addr.arpa.",
DnsRecord.CLASS_IN, 80, "fra24s07-in-f3.1e100.net.");
ByteBuf out = Unpooled.buffer();
ByteBuf expectedBuf = Unpooled.buffer();
expectedBuf.writeBytes(
new byte[] {
3, '1', '3', '1',
3, '1', '8', '6',
3, '2', '5', '0',
3, '1', '4', '2',
7, 'i', 'n', '-', 'a', 'd', 'd', 'r',
4, 'a', 'r', 'p', 'a',
0
});
expectedBuf.writeShort(DnsRecordType.PTR.intValue());
expectedBuf.writeShort(DnsRecord.CLASS_IN);
expectedBuf.writeInt(80);
byte[] hostname = new byte[] {
14, 'f', 'r', 'a', '2', '4', 's', '0', '7', '-', 'i', 'n', '-', 'f', '3',
5, '1', 'e', '1', '0', '0', 3, 'n', 'e', 't',
0
};
expectedBuf.writeShort(hostname.length);
expectedBuf.writeBytes(hostname);
try {
encoder.encodeRecord(ptrRecord, out);
assertEquals(expectedBuf, out);
} finally {
out.release();
expectedBuf.release();
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testEncodePtr() do?
testEncodePtr() is a function in the netty codebase, defined in codec-dns/src/test/java/io/netty/handler/codec/dns/DefaultDnsRecordEncoderTest.java.
Where is testEncodePtr() defined?
testEncodePtr() is defined in codec-dns/src/test/java/io/netty/handler/codec/dns/DefaultDnsRecordEncoderTest.java at line 32.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free