Package io.netty.handler.codec.dns
Class DefaultDnsRecordEncoder
- java.lang.Object
-
- io.netty.handler.codec.dns.DefaultDnsRecordEncoder
-
- All Implemented Interfaces:
DnsRecordEncoder
@UnstableApi public class DefaultDnsRecordEncoder extends java.lang.Object implements DnsRecordEncoder
The defaultDnsRecordEncoder
implementation.- See Also:
DefaultDnsRecordDecoder
-
-
Field Summary
Fields Modifier and Type Field Description private static int
PREFIX_MASK
-
Fields inherited from interface io.netty.handler.codec.dns.DnsRecordEncoder
DEFAULT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultDnsRecordEncoder()
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static int
calculateEcsAddressLength(int sourcePrefixLength, int lowOrderBitsToPreserve)
protected void
encodeName(java.lang.String name, ByteBuf buf)
private void
encodeOptEcsRecord(DnsOptEcsRecord record, ByteBuf out)
private void
encodeOptPseudoRecord(DnsOptPseudoRecord record, ByteBuf out)
private void
encodePtrRecord(DnsPtrRecord record, ByteBuf out)
void
encodeQuestion(DnsQuestion question, ByteBuf out)
Encodes aDnsQuestion
.private void
encodeRawRecord(DnsRawRecord record, ByteBuf out)
void
encodeRecord(DnsRecord record, ByteBuf out)
Encodes aDnsRecord
.private void
encodeRecord0(DnsRecord record, ByteBuf out)
private static byte
padWithZeros(byte b, int lowOrderBitsToPreserve)
-
-
-
Field Detail
-
PREFIX_MASK
private static final int PREFIX_MASK
- See Also:
- Constant Field Values
-
-
Method Detail
-
encodeQuestion
public final void encodeQuestion(DnsQuestion question, ByteBuf out) throws java.lang.Exception
Description copied from interface:DnsRecordEncoder
Encodes aDnsQuestion
.- Specified by:
encodeQuestion
in interfaceDnsRecordEncoder
out
- the output buffer where the encoded question will be written to- Throws:
java.lang.Exception
-
encodeRecord
public void encodeRecord(DnsRecord record, ByteBuf out) throws java.lang.Exception
Description copied from interface:DnsRecordEncoder
Encodes aDnsRecord
.- Specified by:
encodeRecord
in interfaceDnsRecordEncoder
out
- the output buffer where the encoded record will be written to- Throws:
java.lang.Exception
-
encodeRecord0
private void encodeRecord0(DnsRecord record, ByteBuf out) throws java.lang.Exception
- Throws:
java.lang.Exception
-
encodePtrRecord
private void encodePtrRecord(DnsPtrRecord record, ByteBuf out) throws java.lang.Exception
- Throws:
java.lang.Exception
-
encodeOptPseudoRecord
private void encodeOptPseudoRecord(DnsOptPseudoRecord record, ByteBuf out) throws java.lang.Exception
- Throws:
java.lang.Exception
-
encodeOptEcsRecord
private void encodeOptEcsRecord(DnsOptEcsRecord record, ByteBuf out) throws java.lang.Exception
- Throws:
java.lang.Exception
-
calculateEcsAddressLength
static int calculateEcsAddressLength(int sourcePrefixLength, int lowOrderBitsToPreserve)
-
encodeRawRecord
private void encodeRawRecord(DnsRawRecord record, ByteBuf out) throws java.lang.Exception
- Throws:
java.lang.Exception
-
encodeName
protected void encodeName(java.lang.String name, ByteBuf buf) throws java.lang.Exception
- Throws:
java.lang.Exception
-
padWithZeros
private static byte padWithZeros(byte b, int lowOrderBitsToPreserve)
-
-