Package com.cosylab.epics.caj.util
Class InetAddressUtil
- java.lang.Object
-
- com.cosylab.epics.caj.util.InetAddressUtil
-
public class InetAddressUtil extends Object
InetAddressutility methods.- Version:
- $id$
- Author:
- Matej Sekoranja
-
-
Constructor Summary
Constructors Constructor Description InetAddressUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InetSocketAddress[]getSocketAddressList(String list, int defaultPort)Parse space delimited addresss[:port] string and return array ofInetSocketAddress.static InetSocketAddress[]getSocketAddressList(String list, int defaultPort, InetSocketAddress[] appendList)Parse space delimited addresss[:port] string and return array ofInetSocketAddress.static InetAddressintToIPv4Address(int addr)Convert an integer into an IPv4 INET address.static intipv4AddressToInt(InetAddress addr)Convert an IPv4 INET address to an integer.
-
-
-
Method Detail
-
intToIPv4Address
public static InetAddress intToIPv4Address(int addr)
Convert an integer into an IPv4 INET address.- Parameters:
addr- integer representation of a given address.- Returns:
- IPv4 INET address.
-
ipv4AddressToInt
public static int ipv4AddressToInt(InetAddress addr)
Convert an IPv4 INET address to an integer.- Parameters:
addr- IPv4 INET address.- Returns:
- integer representation of a given address.
- Throws:
IllegalArgumentException- if the address is really an IPv6 address
-
getSocketAddressList
public static InetSocketAddress[] getSocketAddressList(String list, int defaultPort)
Parse space delimited addresss[:port] string and return array ofInetSocketAddress.- Parameters:
list- space delimited addresss[:port] string.defaultPort- port take if not specified.- Returns:
- array of
InetSocketAddress.
-
getSocketAddressList
public static InetSocketAddress[] getSocketAddressList(String list, int defaultPort, InetSocketAddress[] appendList)
Parse space delimited addresss[:port] string and return array ofInetSocketAddress.- Parameters:
list- space delimited addresss[:port] string.defaultPort- port take if not specified.appendList- list to be appended.- Returns:
- array of
InetSocketAddress.
-
-