org.ipdr.utils
Class IPV6AddrUtil

java.lang.Object
  extended by org.ipdr.utils.IPV6AddrUtil

public class IPV6AddrUtil
extends java.lang.Object

This class is added to include the method for conversion of string of IPv6 Address to byte array and back to string and validate IPv6 address.


Field Summary
static int IPV6_SIZE
          To store the size of IPv6 string
 
Constructor Summary
IPV6AddrUtil()
           
 
Method Summary
static byte[] convIPV6AddrToByteArray(java.lang.String ipV6Addr)
          This method takes the IPv6 Address string format as per pattern specified in the NDM-U 3.0 specification as input and converts it into Byte array.
static java.lang.String IPV6AddrToString(byte[] ipV6Addr)
          Generates a printable string containing the byte array in the standard IPv6 Address format.
static void validateIPv6Addr(java.lang.String IPAddr)
          This method will validate whether the input IP Address is in proper format for IPv6.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IPV6_SIZE

public static final int IPV6_SIZE
To store the size of IPv6 string

See Also:
Constant Field Values
Constructor Detail

IPV6AddrUtil

public IPV6AddrUtil()
Method Detail

convIPV6AddrToByteArray

public static byte[] convIPV6AddrToByteArray(java.lang.String ipV6Addr)
                                      throws IPDRException
This method takes the IPv6 Address string format as per pattern specified in the NDM-U 3.0 specification as input and converts it into Byte array.

Parameters:
ipV6Addr - IPv6 Address in String format
Returns:
Byte array equivalent
Throws:
IPDRException

IPV6AddrToString

public static java.lang.String IPV6AddrToString(byte[] ipV6Addr)
                                         throws IPDRException
Generates a printable string containing the byte array in the standard IPv6 Address format.

Parameters:
ipV6Addr - 16 byte array containing a valid IPv6 Address.
Returns:
The IPv6 Address in the standard printable (colon) format.
Throws:
IPDRException

validateIPv6Addr

public static void validateIPv6Addr(java.lang.String IPAddr)
                             throws IPDRException
This method will validate whether the input IP Address is in proper format for IPv6.

Parameters:
IPAddr - IP Address to be validated in Hexadecimal String
Throws:
IPDRException