public static int familyOf ( InetAddress address ) { if ( address instanceof Inet4Address ) return IPv4 ; if ( address instanceof Inet6Address ) return IPv6 ; throw new IllegalArgumentException ( "unknown address family" ) ; }
Returns the family of an InetAddress .