jerklib.util
Class InetAddressUtils

java.lang.Object
  extended by jerklib.util.InetAddressUtils

public class InetAddressUtils
extends Object

Utility functions related to IP Addresses.

Author:
Andres N. Kievsky

Constructor Summary
InetAddressUtils()
           
 
Method Summary
static byte[] numericIpToByteArray(long ip)
          Given an ip in numeric format, return a byte array that can be fed to InetAddress.
static InetAddress parseNumericIp(long ip)
          Given an ip in numeric format, return the InetAddress.
static InetAddress parseNumericIp(String ip)
          Given an ip in a numeric, string format, return the InetAddress.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InetAddressUtils

public InetAddressUtils()
Method Detail

parseNumericIp

public static InetAddress parseNumericIp(String ip)
Given an ip in a numeric, string format, return the InetAddress.

Parameters:
ip - the ip address in string format (such as 3232235780)
Returns:
the InetAddress object (such as the object representing 192.168.1.4)

parseNumericIp

public static InetAddress parseNumericIp(long ip)
Given an ip in numeric format, return the InetAddress.

Parameters:
ip - the ip address in long (such as 3232235780)
Returns:
the InetAddress object (such as the object representing 192.168.1.4)

numericIpToByteArray

public static byte[] numericIpToByteArray(long ip)
Given an ip in numeric format, return a byte array that can be fed to InetAddress.

Parameters:
ip - the ip address in long (such as 3232235780)
Returns:
the byte array.