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

public Class DefaultDnsRecordDecoder

extends Object
implements DnsRecordDecoder
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.dns.DnsRecordDecoder
Annotations
@UnstableApi
Imports
io.netty5.buffer.Buffer, .BufferAllocator, io.netty5.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
(Buffer
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
(Buffer
the byte buffer containing the DNS packet
in
)

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

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

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

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

Implements io.netty5.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
,
BufferAllocator allocator, Buffer
the Buffer 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 DnsRecordDecoder#decodeRecord(BufferAllocator, Buffer).

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(Buffer 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:Buffer

the byte buffer containing the DNS packet

Returns:String

the domain name for an entry

decodeName0back to summary
protected String decodeName0(Buffer 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:Buffer

the byte buffer containing the DNS packet

Returns:String

the domain name for an entry

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

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

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

Decodes a DNS question into its object representation.

Parameters
in:Buffer

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

Annotations
@Override
decodeRecordback to summary
public final <T extends DnsRecord> T decodeRecord(BufferAllocator allocator, Buffer in) throws Exception

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

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

Decodes a DNS record into its object representation.

Parameters
in:Buffer

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, BufferAllocator allocator, Buffer in, int offset, int length) throws Exception

Decodes a record from the information decoded so far by DnsRecordDecoder#decodeRecord(BufferAllocator, Buffer).

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:Buffer

the Buffer 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.