Top Description Fields Constructors Methods
io.netty.handler.codec.dns

public Class DefaultDnsRecordDecoder

extends Object
implements DnsRecordDecoder
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.dns.DnsRecordDecoder
Annotations
@UnstableApi
Imports
io.netty.buffer.ByteBuf, io.netty.util.internal.UnstableApi

The default DnsRecordDecoder implementation.
See Also
DefaultDnsRecordEncoder

Field Summary

Modifier and TypeField and Description
pack-priv static final String

Constructor Summary

AccessConstructor and Description
protected
DefaultDnsRecordDecoder()

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

the domain name for an entry
decodeName
(ByteBuf
the byte buffer containing the DNS packet
in
)

Retrieves a domain name given a buffer containing a DNS packet.

protected String

Returns:

the domain name for an entry
decodeName0
(ByteBuf
the byte buffer containing the DNS packet
in
)

Retrieves a domain name given a buffer containing a DNS packet.

public final DnsQuestion
decodeQuestion(ByteBuf
the input buffer which contains a DNS question at its reader index
in
)

Implements io.netty.handler.codec.dns.DnsRecordDecoder.decodeQuestion.

Decodes a DNS question into its object representation.
public final <T extends DnsRecord> T
decodeRecord(ByteBuf
the input buffer which contains a DNS record at its reader index
in
)

Implements io.netty.handler.codec.dns.DnsRecordDecoder.decodeRecord.

Decodes a DNS record into its object representation.
protected DnsRecord

Returns:

a DnsRawRecord. Override this method to decode RDATA and return other record implementation.
decodeRecord
(String
the domain name of the record
name
,
DnsRecordType
the type of the record
type
,
int
the class of the record
dnsClass
,
long
the TTL of the record
timeToLive
,
ByteBuf
the ByteBuf that contains the RDATA
in
,
int
the start offset of the RDATA in in
offset
,
int
the length of the RDATA
length
)

Decodes a record from the information decoded so far by decodeRecord(ByteBuf).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ROOTback to summary
pack-priv static final String ROOT

Constructor Detail

DefaultDnsRecordDecoderback to summary
protected DefaultDnsRecordDecoder()

Creates a new instance.

Method Detail

decodeNameback to summary
public static String decodeName(ByteBuf in)

Retrieves a domain name given a buffer containing a DNS packet. If the name contains a pointer, the position of the buffer will be set to directly after the pointer's index after the name has been read.

Parameters
in:ByteBuf

the byte buffer containing the DNS packet

Returns:String

the domain name for an entry

decodeName0back to summary
protected String decodeName0(ByteBuf in)

Retrieves a domain name given a buffer containing a DNS packet. If the name contains a pointer, the position of the buffer will be set to directly after the pointer's index after the name has been read.

Parameters
in:ByteBuf

the byte buffer containing the DNS packet

Returns:String

the domain name for an entry

decodeQuestionback to summary
public final DnsQuestion decodeQuestion(ByteBuf in) throws Exception

Implements io.netty.handler.codec.dns.DnsRecordDecoder.decodeQuestion.

Doc from io.netty.handler.codec.dns.DnsRecordDecoder.decodeQuestion.

Decodes a DNS question into its object representation.

Parameters
in:ByteBuf

the input buffer which contains a DNS question at its reader index

Annotations
@Override
decodeRecordback to summary
public final <T extends DnsRecord> T decodeRecord(ByteBuf in) throws Exception

Implements io.netty.handler.codec.dns.DnsRecordDecoder.decodeRecord.

Doc from io.netty.handler.codec.dns.DnsRecordDecoder.decodeRecord.

Decodes a DNS record into its object representation.

Parameters
in:ByteBuf

the input buffer which contains a DNS record at its reader index

Returns:T

the decoded record, or null if there are not enough data in the input buffer

Annotations
@Override
decodeRecordback to summary
protected DnsRecord decodeRecord(String name, DnsRecordType type, int dnsClass, long timeToLive, ByteBuf in, int offset, int length) throws Exception

Decodes a record from the information decoded so far by decodeRecord(ByteBuf).

Parameters
name:String

the domain name of the record

type:DnsRecordType

the type of the record

dnsClass:int

the class of the record

timeToLive:long

the TTL of the record

in:ByteBuf

the ByteBuf that contains the RDATA

offset:int

the start offset of the RDATA in in

length:int

the length of the RDATA

Returns:DnsRecord

a DnsRawRecord. Override this method to decode RDATA and return other record implementation.