com.cosylab.epics.caj.util
Class InetAddressUtil

java.lang.Object
  extended by com.cosylab.epics.caj.util.InetAddressUtil

public class InetAddressUtil
extends Object

InetAddress utility methods.

Version:
$id$
Author:
Matej Sekoranja

Constructor Summary
InetAddressUtil()
           
 
Method Summary
static InetSocketAddress[] getSocketAddressList(String list, int defaultPort)
          Parse space delimited addresss[:port] string and return array of InetSocketAddress.
static InetSocketAddress[] getSocketAddressList(String list, int defaultPort, InetSocketAddress[] appendList)
          Parse space delimited addresss[:port] string and return array of InetSocketAddress.
static InetAddress intToIPv4Address(int addr)
          Convert an integer into an IPv4 INET address.
static int ipv4AddressToInt(InetAddress addr)
          Convert an IPv4 INET address to an integer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InetAddressUtil

public InetAddressUtil()
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 of InetSocketAddress.

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 of InetSocketAddress.

Parameters:
list - space delimited addresss[:port] string.
defaultPort - port take if not specified.
appendList - list to be appended.
Returns:
array of InetSocketAddress.


Copyright © 2004-2013 Cosylab. All Rights Reserved.