|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Jan 2006
Messaggi: 64
|
[Java] InetAddress: cos'e' il secondo parametro?
Codice:
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 |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Dec 2002
Messaggi: 3359
|
è l'ip inteso come array di byte
|
![]() |
![]() |
![]() |
#3 | |
Member
Iscritto dal: Jan 2006
Messaggi: 64
|
Quote:
Codice:
InetAddress oggetto = InetAddress.getByAddress( 192.168.0.1, [qui_che_metto?]) |
|
![]() |
![]() |
![]() |
#4 | |
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
Codice:
InetAddress addr = InetAddress.getByAddress (new byte[] { (byte) 192, (byte) 168, 0, 1 });
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) Ultima modifica di andbin : 20-07-2006 alle 12:38. |
|
![]() |
![]() |
![]() |
#5 | |
Member
Iscritto dal: Jan 2006
Messaggi: 64
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 10:37.