Class DnsQueryEncoder


  • final class DnsQueryEncoder
    extends java.lang.Object
    • Constructor Detail

      • DnsQueryEncoder

        DnsQueryEncoder​(DnsRecordEncoder recordEncoder)
        Creates a new encoder with the specified recordEncoder.
    • Method Detail

      • encode

        void encode​(DnsQuery query,
                    ByteBuf out)
             throws java.lang.Exception
        Encodes the given DnsQuery into a ByteBuf.
        Throws:
        java.lang.Exception
      • encodeHeader

        private static void encodeHeader​(DnsQuery query,
                                         ByteBuf buf)
        Encodes the header that is always 12 bytes long.
        Parameters:
        query - the query header being encoded
        buf - the buffer the encoded data should be written to
      • encodeQuestions

        private void encodeQuestions​(DnsQuery query,
                                     ByteBuf buf)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • encodeRecords

        private void encodeRecords​(DnsQuery query,
                                   DnsSection section,
                                   ByteBuf buf)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception