@UnstableApi public class DefaultDnsRecordDecoder extends Object implements DnsRecordDecoder
DnsRecordDecoder
implementation.DefaultDnsRecordEncoder
DEFAULT
Modifier | Constructor and Description |
---|---|
protected |
DefaultDnsRecordDecoder()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
static String |
decodeName(ByteBuf in)
Retrieves a domain name given a buffer containing a DNS packet.
|
protected 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(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) . |
protected DefaultDnsRecordDecoder()
public final DnsQuestion decodeQuestion(ByteBuf in) throws Exception
DnsRecordDecoder
decodeQuestion
in interface DnsRecordDecoder
in
- the input buffer which contains a DNS question at its reader indexException
public final <T extends DnsRecord> T decodeRecord(ByteBuf in) throws 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 bufferException
protected DnsRecord decodeRecord(String name, DnsRecordType type, int dnsClass, long timeToLive, ByteBuf in, int offset, int length) throws 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.Exception
protected String decodeName0(ByteBuf in)
in
- the byte buffer containing the DNS packetpublic static String decodeName(ByteBuf in)
in
- the byte buffer containing the DNS packetCopyright © 2008–2017 The Netty Project. All rights reserved.