Java InetAddress Check isIPv6(final InetAddress ip)

Here you can find the source of isIPv6(final InetAddress ip)

Description

True if this InetAddress is a raw IPv6 in dotted quad notation.

License

Apache License

Declaration

public static boolean isIPv6(final InetAddress ip) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.net.Inet6Address;
import java.net.InetAddress;

public class Main {
    /** True if this InetAddress is a raw IPv6 in dotted quad notation. */
    public static boolean isIPv6(final InetAddress ip) {
        return ip instanceof Inet6Address
                && ip.getHostName().equals(ip.getHostAddress());
    }//  ww w .j  a v a  2  s .com
}

Related

  1. isHostLocalHost(InetAddress host)
  2. isInet6Compatible(InetAddress address, Inet6Address inet6Address)
  3. isInRage(InetAddress check, InetAddress bcast, int netmask)
  4. isIpAddressInRange(InetAddress ipStart, InetAddress ipEnd, InetAddress ipToCheck)
  5. isIPLocal(final InetAddress adr)
  6. isIPv6(InetAddress addr)
  7. isIPv6UniqueSiteLocal(InetAddress address)
  8. isLikelyBroadcast(InetAddress address)
  9. isLinkLocalIPv4Address(InetAddress add)