java.net

Class Inet6Address

public final class Inet6Address extends InetAddress

Method Summary
booleanequals(Object obj)
Compares this object against the specified object
byte[]getAddress()
Returns the raw IP address of this InetAddress object.
static Inet6AddressgetByAddress(String host, byte[] addr, int scopeId)
Creates a scoped Inet6Address where the scope has an integer id.
static Inet6AddressgetByAddress(String host, byte[] addr, NetworkInterface nif)
Creates a scoped Inet6Address where the scope is a given NetworkInterface.
StringgetHostAddress()
Returns the IP address string in textual presentation
NetworkInterfacegetScopedInterface()
Returns the NetworkInterface of the address scope if it is a scoped address and the scope is given in the form of a NetworkInterface.
intgetScopeId()
Returns the scope ID of the address scope if it is a scoped adress using an integer to identify the scope.
inthashCode()
Returns a hashcode for this IP address (The hashcode is independent of scope)
booleanisAnyLocalAddress()
Utility routine to check if the InetAddress in a wildcard address
booleanisIPv4CompatibleAddress()
Utility routine to check if the InetAddress is an IPv4 compatible IPv6 address
booleanisLinkLocalAddress()
Utility routine to check if the InetAddress is an link local address
booleanisLoopbackAddress()
Utility routine to check if the InetAddress is a loopback address
booleanisMCGlobal()
Utility routine to check if the multicast address has global scope
booleanisMCLinkLocal()
Utility routine to check if the multicast address has link scope
booleanisMCNodeLocal()
Utility routine to check if the multicast address has node scope
booleanisMCOrgLocal()
Utility routine to check if the multicast address has organization scope
booleanisMCSiteLocal()
Utility routine to check if the multicast address has site scope
booleanisMulticastAddress()
Utility routine to check if the InetAddress is an IP multicast address
booleanisSiteLocalAddress()
Utility routine to check if the InetAddress is a site local address

Method Detail

equals

public boolean equals(Object obj)
Compares this object against the specified object

getAddress

public byte[] getAddress()
Returns the raw IP address of this InetAddress object. The result is in network byte order: the highest order byte of the address is i n getAddress()[0]

getByAddress

public static Inet6Address getByAddress(String host, byte[] addr, int scopeId)
Creates a scoped Inet6Address where the scope has an integer id.

Throws: UnkownHostException if the address is an invalid number of bytes.

Since: 1.5

getByAddress

public static Inet6Address getByAddress(String host, byte[] addr, NetworkInterface nif)
Creates a scoped Inet6Address where the scope is a given NetworkInterface.

Throws: UnkownHostException if the address is an invalid number of bytes.

Since: 1.5

getHostAddress

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

getScopedInterface

public NetworkInterface getScopedInterface()
Returns the NetworkInterface of the address scope if it is a scoped address and the scope is given in the form of a NetworkInterface. (I.e. the address was created using the getByAddress(String, byte[], NetworkInterface) method) Otherwise this method returns null.

Since: 1.5

getScopeId

public int getScopeId()
Returns the scope ID of the address scope if it is a scoped adress using an integer to identify the scope. Otherwise this method returns 0.

Since: 1.5

hashCode

public int hashCode()
Returns a hashcode for this IP address (The hashcode is independent of scope)

isAnyLocalAddress

public boolean isAnyLocalAddress()
Utility routine to check if the InetAddress in a wildcard address

Since: 1.4

isIPv4CompatibleAddress

public boolean isIPv4CompatibleAddress()
Utility routine to check if the InetAddress is an IPv4 compatible IPv6 address

Since: 1.4

isLinkLocalAddress

public boolean isLinkLocalAddress()
Utility routine to check if the InetAddress is an link local address

Since: 1.4

isLoopbackAddress

public boolean isLoopbackAddress()
Utility routine to check if the InetAddress is a loopback address

Since: 1.4

isMCGlobal

public boolean isMCGlobal()
Utility routine to check if the multicast address has global scope

Since: 1.4

isMCLinkLocal

public boolean isMCLinkLocal()
Utility routine to check if the multicast address has link scope

Since: 1.4

isMCNodeLocal

public boolean isMCNodeLocal()
Utility routine to check if the multicast address has node scope

Since: 1.4

isMCOrgLocal

public boolean isMCOrgLocal()
Utility routine to check if the multicast address has organization scope

Since: 1.4

isMCSiteLocal

public boolean isMCSiteLocal()
Utility routine to check if the multicast address has site scope

Since: 1.4

isMulticastAddress

public boolean isMulticastAddress()
Utility routine to check if the InetAddress is an IP multicast address

Since: 1.1

isSiteLocalAddress

public boolean isSiteLocalAddress()
Utility routine to check if the InetAddress is a site local address

Since: 1.4