顯示具有 Java i/o 標籤的文章。 顯示所有文章
顯示具有 Java i/o 標籤的文章。 顯示所有文章

2008年1月28日 星期一

IPv6 on java

連線的IP字串格式:
fe80::21d:7dff:fe91:b561%en0
IP後面要加上%和出去的interface

2008年1月27日 星期日

Java Socket

InetAddress getLocalAddress():
Gets the local address to which the socket is bound.

public class InetAddress
An IP address is either a 32-bit or 128-bit unsigned number used by IP

2008年1月24日 星期四

java 輸出

boolean 的變數:
印出true or false

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