Method Summary |
|
public static int | addressLength(int family) Returns the length of an address in a particular family.
Parameters: family - The address family, either IPv4 or IPv6. |
public static int | familyOf(InetAddress address) Returns the family of an InetAddress.
Parameters: address - The supplied address. |
public static InetAddress[] | getAllByName(String name) |
public static InetAddress | getByAddress(String addr) Converts an address from its string representation to an IP address. |
public static InetAddress | getByAddress(String addr, int family) Converts an address from its string representation to an IP address in
a particular family.
Parameters: addr - The address, in string form Parameters: family - The address family, either IPv4 or IPv6. |
public static InetAddress | getByName(String name) |
public static String | getHostName(InetAddress addr) |
public static boolean | isDottedQuad(String s) Determines if a string contains a valid IP address. |
public static int[] | toArray(String s, int family) Convert a string containing an IP address to an array of 4 or 16 integers.
Parameters: s - The address, in text format. Parameters: family - The address family. |
public static int[] | toArray(String s) Convert a string containing an IPv4 address to an array of 4 integers.
Parameters: s - The address, in text format. |
public static byte[] | toByteArray(String s, int family) Convert a string containing an IP address to an array of 4 or 16 bytes.
Parameters: s - The address, in text format. Parameters: family - The address family. |
public static String | toDottedQuad(byte[] addr) Converts a byte array containing an IPv4 address into a dotted quad string. |
public static String | toDottedQuad(int[] addr) Converts an int array containing an IPv4 address into a dotted quad string. |