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 defaultDnsRecordEncoderimplementation.- See Also:
DefaultDnsRecordDecoder
-
-
Field Summary
Fields Modifier and Type Field Description private static intPREFIX_MASK-
Fields inherited from interface io.netty.handler.codec.dns.DnsRecordEncoder
DEFAULT
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultDnsRecordEncoder()Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static intcalculateEcsAddressLength(int sourcePrefixLength, int lowOrderBitsToPreserve)protected voidencodeName(java.lang.String name, ByteBuf buf)private voidencodeOptEcsRecord(DnsOptEcsRecord record, ByteBuf out)private voidencodeOptPseudoRecord(DnsOptPseudoRecord record, ByteBuf out)private voidencodePtrRecord(DnsPtrRecord record, ByteBuf out)voidencodeQuestion(DnsQuestion question, ByteBuf out)Encodes aDnsQuestion.private voidencodeRawRecord(DnsRawRecord record, ByteBuf out)voidencodeRecord(DnsRecord record, ByteBuf out)Encodes aDnsRecord.private voidencodeRecord0(DnsRecord record, ByteBuf out)private static bytepadWithZeros(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:DnsRecordEncoderEncodes aDnsQuestion.- Specified by:
encodeQuestionin interfaceDnsRecordEncoderout- 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:DnsRecordEncoderEncodes aDnsRecord.- Specified by:
encodeRecordin interfaceDnsRecordEncoderout- 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)
-
-