2008年1月23日 星期三

NetworkInterface, InetAddress, Inet6Address

java.net.NetworkInterface

public final class NetworkInterface extends Object

A Network Interface made up of a name, and a list of IP addresses assigned to this interface.

static Enumeration getNetworkInterfaces()
Returns all the interfaces on this machine

java.net Class InetAddress
public class InetAddressextends Object implements Serializable
An instance of an InetAddress consists of an IP address and possibly its corresponding host name

String getHostAddress()
Returns the IP address string in textual presentation

byte[] getAddress()
Returns the raw IP address of this InetAddress object.

java.net Class Inet6Address
public final class Inet6Address extends InetAddress
preferred form is x:x:x:x:x:x:x:x, x is 16進位,16 bits
ex: 1080:0:0:0:8:800:200C:417A

沒有留言: