(Ogg-Vorbis format, 5Mbytes) | (WAV format, 26Mbytes) |
The class java.net.InetAddress
has two subclasses
java.net.Inet4Address
java.net.Inet6Address
InetAddress.getByName(...)
If your network stack is configured to use IPv6, you get an
Inet6Address
, otherwise you get an
Inet4Address
.
You can check if you have an IPv6 address by
if (address instanceof Inet6Address) ...
You can check if a socket uses IPv6 by
if (socket.getLocalAddress() instanceof Inet6Address) ...
The IPv4 localhost
is 127.0.0.1.
The IPv6 localhost
is 0:0:0:0:0:0:0:1
There are methods to tell if an IPv6 address is compatable with an IPv4 address, and some properties that can be set to tell the JVM to prefer IPv4 or IPv6. Apart from that, there appears to be little that Java gives you.