Finalfire
19-07-2006, 21:49
getByAddress
public static InetAddress getByAddress(String host,
byte[] addr)
throws UnknownHostException
Create an InetAddress based on the provided host name and IP address No name service is checked for the validity of the address.
The host name can either be a machine name, such as "java.sun.com", or a textual representation of its IP address.
No validity checking is done on the host name either.
If addr specifies an IPv4 address an instance of Inet4Address will be returned; otherwise, an instance of Inet6Address will be returned.
IPv4 address byte array must be 4 bytes long and IPv6 byte array must be 16 bytes long
Parameters:
host - the specified host
addr - the raw IP address in network byte order
Returns:
an InetAddress object created from the raw IP address.
Throws:
UnknownHostException - if IP address is of illegal length
Since:
1.4
Per il parametro byte[] addr cosa devo passare? Mi scuso ma non riesco proprio a capirlo oO
public static InetAddress getByAddress(String host,
byte[] addr)
throws UnknownHostException
Create an InetAddress based on the provided host name and IP address No name service is checked for the validity of the address.
The host name can either be a machine name, such as "java.sun.com", or a textual representation of its IP address.
No validity checking is done on the host name either.
If addr specifies an IPv4 address an instance of Inet4Address will be returned; otherwise, an instance of Inet6Address will be returned.
IPv4 address byte array must be 4 bytes long and IPv6 byte array must be 16 bytes long
Parameters:
host - the specified host
addr - the raw IP address in network byte order
Returns:
an InetAddress object created from the raw IP address.
Throws:
UnknownHostException - if IP address is of illegal length
Since:
1.4
Per il parametro byte[] addr cosa devo passare? Mi scuso ma non riesco proprio a capirlo oO