@UnstableApi public class DefaultDnsRecordDecoder extends java.lang.Object implements DnsRecordDecoder
DnsRecordDecoder implementation.DefaultDnsRecordEncoderDEFAULT| 限定符 | 构造器和说明 |
|---|---|
protected |
DefaultDnsRecordDecoder()
Creates a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static java.lang.String |
decodeName(ByteBuf in)
Retrieves a domain name given a buffer containing a DNS packet.
|
protected java.lang.String |
decodeName0(ByteBuf in)
Retrieves a domain name given a buffer containing a DNS packet.
|
DnsQuestion |
decodeQuestion(ByteBuf in)
Decodes a DNS question into its object representation.
|
<T extends DnsRecord> |
decodeRecord(ByteBuf in)
Decodes a DNS record into its object representation.
|
protected DnsRecord |
decodeRecord(java.lang.String name,
DnsRecordType type,
int dnsClass,
long timeToLive,
ByteBuf in,
int offset,
int length)
Decodes a record from the information decoded so far by
decodeRecord(ByteBuf). |
public final DnsQuestion decodeQuestion(ByteBuf in) throws java.lang.Exception
DnsRecordDecoderdecodeQuestion 在接口中 DnsRecordDecoderin - the input buffer which contains a DNS question at its reader indexjava.lang.Exceptionpublic final <T extends DnsRecord> T decodeRecord(ByteBuf in) throws java.lang.Exception
DnsRecordDecoderdecodeRecord 在接口中 DnsRecordDecoderin - the input buffer which contains a DNS record at its reader indexnull if there are not enough data in the input bufferjava.lang.Exceptionprotected DnsRecord decodeRecord(java.lang.String name, DnsRecordType type, int dnsClass, long timeToLive, ByteBuf in, int offset, int length) throws java.lang.Exception
decodeRecord(ByteBuf).name - the domain name of the recordtype - the type of the recorddnsClass - the class of the recordtimeToLive - the TTL of the recordin - the ByteBuf that contains the RDATAoffset - the start offset of the RDATA in inlength - the length of the RDATADnsRawRecord. Override this method to decode RDATA and return other record implementation.java.lang.Exceptionprotected java.lang.String decodeName0(ByteBuf in)
in - the byte buffer containing the DNS packetpublic static java.lang.String decodeName(ByteBuf in)
in - the byte buffer containing the DNS packet