utilities.network
Class IPUtils

java.lang.Object
  extended by utilities.network.IPUtils

public class IPUtils
extends java.lang.Object

A utility class to find out certain bits of information about the network status/capabilities of the current host.


Constructor Summary
IPUtils()
           
 
Method Summary
static byte[] getExternalAddress()
          Returns the external IP address of the local host if possible, if not it returns the loopback address
static byte[] getExternalAddress(java.net.InetAddress host)
          Returns the external IP address of the specified host if possible, if not it returns the loopback address
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPUtils

public IPUtils()
Method Detail

getExternalAddress

public static byte[] getExternalAddress()
Returns the external IP address of the local host if possible, if not it returns the loopback address

Returns:
an IP address in byte[] form

getExternalAddress

public static byte[] getExternalAddress(java.net.InetAddress host)
Returns the external IP address of the specified host if possible, if not it returns the loopback address

Parameters:
host -
Returns:
an IP address in byte[] form