Class DnsAddressDecoder


  • final class DnsAddressDecoder
    extends java.lang.Object
    Decodes an InetAddress from an A or AAAA DnsRawRecord.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int INADDRSZ4  
      private static int INADDRSZ6  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DnsAddressDecoder()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static java.net.InetAddress decodeAddress​(DnsRecord record, java.lang.String name, boolean decodeIdn)
      Decodes an InetAddress from an A or AAAA DnsRawRecord.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DnsAddressDecoder

        private DnsAddressDecoder()
    • Method Detail

      • decodeAddress

        static java.net.InetAddress decodeAddress​(DnsRecord record,
                                                  java.lang.String name,
                                                  boolean decodeIdn)
        Decodes an InetAddress from an A or AAAA DnsRawRecord.
        Parameters:
        record - the DnsRecord, most likely a DnsRawRecord
        name - the host name of the decoded address
        decodeIdn - whether to convert name to a unicode host name
        Returns:
        the InetAddress, or null if record is not a DnsRawRecord or its content is malformed