@UnstableApi public class DefaultDnsRecordDecoder extends java.lang.Object implements DnsRecordDecoder
DnsRecordDecoder
implementation.DefaultDnsRecordEncoder
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
ROOT |
DEFAULT
Modifier | Constructor and Description |
---|---|
protected |
DefaultDnsRecordDecoder()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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) . |
static final java.lang.String ROOT
protected DefaultDnsRecordDecoder()
public final DnsQuestion decodeQuestion(ByteBuf in) throws java.lang.Exception
DnsRecordDecoder
decodeQuestion
in interface DnsRecordDecoder
in
- the input buffer which contains a DNS question at its reader indexjava.lang.Exception
public final <T extends DnsRecord> T decodeRecord(ByteBuf in) throws java.lang.Exception
DnsRecordDecoder
decodeRecord
in interface DnsRecordDecoder
in
- the input buffer which contains a DNS record at its reader indexnull
if there are not enough data in the input bufferjava.lang.Exception
protected 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 in
length
- the length of the RDATADnsRawRecord
. Override this method to decode RDATA and return other record implementation.java.lang.Exception
protected 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