jcontrol.net
Class InetAddress

java.lang.Object
  extended by jcontrol.net.InetAddress

public class InetAddress
extends Object

JControl - InetAddress Implementation. This class represents an Internet Protocol (IPv4) address.


Method Summary
 byte[] getAddress()
          Returns the raw IP address of this InetAddress object.
static InetAddress getByAddress(byte[] addr)
          Returns an InetAddress object given the raw IP address.
static InetAddress getLocalHost()
          Returns the local host.
 String toString()
          Converts this IP address to a String.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notifyAll, wait
 

Method Detail

getByAddress

public static InetAddress getByAddress(byte[] addr)
Returns an InetAddress object given the raw IP address. The argument is in network byte order: the highest order byte of the address is in getAddress()[0]. IPv4 address byte array must be 4 bytes long.

Parameters:
addr - - the raw IP address in network byte order
Returns:
an InetAddress object created from the raw IP address.
Throws:
IllegalArgumenException - - if IP address is of illegal length

getLocalHost

public static InetAddress getLocalHost()
                                throws IOException
Returns the local host.

Returns:
the IP address of the local host.
Throws:
IOException - - if no IP address for the host could be found.

getAddress

public byte[] getAddress()
Returns the raw IP address of this InetAddress object. The result is in network byte order: the highest order byte of the address is in getAddress()[0].

Returns:
the raw IP address of this object.

toString

public String toString()
Converts this IP address to a String. The string returned is of the form: 'a.b.c.d'.

Overrides:
toString in class Object
Returns:
a string representation of this IP address.