Facing problem with java.net.InetAddress class while validating special form of IPv6 address.
please check the following piece of code.
String ipv6 = "0:0:0:0:0:ffff:a1f:e403";
try{
final Inet6Address i6 = (Inet6Address) InetAddress.getByName(ipv6);
System.out.println(i6);
}
catch(ClassCastException e){
System.out.println("Not a proper ip: "+e);
}
It is throwing ClassCastException.