public final class Inet4Address extends InetAddress implements Serializable
Modifier and Type | Method and Description |
---|---|
byte[] |
getAddress()
Returns the raw IP address of this InetAddress object
|
boolean |
isAnyLocalAddress()
Returns whether this is a wildcard address or not.
|
boolean |
isLinkLocalAddress()
Returns whether this address is a link-local address or not.
|
boolean |
isLoopbackAddress()
Returns whether this address is a loopback address or not.
|
boolean |
isMCGlobal()
Returns whether this address is a global multicast address or not.
|
boolean |
isMCLinkLocal()
Returns whether this address is a link-local multicast address or not.
|
boolean |
isMCOrgLocal()
Returns whether this address is a organization-local multicast address or
not.
|
boolean |
isMCSiteLocal()
Returns whether this address is a site-local multicast address or not.
|
boolean |
isMulticastAddress()
Checks if the InetAddress is a multicast address
IP Multicast Addresses (Class D) range from 224.0.0.0 to 239.255.255.255
|
boolean |
isSiteLocalAddress()
Returns whether this address is a site-local address or not.
|
equals, getAllByName, getByAddress, getByAddress, getByName, getCanonicalHostName, getHostAddress, getHostName, getLocalHost, hashCode, isMCNodeLocal, toString
public byte[] getAddress()
InetAddress
getAddress
in class InetAddress
public boolean isMulticastAddress()
InetAddress
isMulticastAddress
in class InetAddress
public boolean isAnyLocalAddress()
InetAddress
false
.isAnyLocalAddress
in class InetAddress
true
if this instance represents a wildcard address,
false
otherwise.public boolean isLinkLocalAddress()
InetAddress
false
.
Valid IPv6 link-local addresses are FE80::0 through to FEBF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF.
There are no valid IPv4 link-local addresses.
isLinkLocalAddress
in class InetAddress
true
if this instance represents a link-local address,
false
otherwise.public boolean isLoopbackAddress()
InetAddress
false
. Valid IPv4 loopback
addresses are 127.d.d.d The only valid IPv6 loopback address is ::1.isLoopbackAddress
in class InetAddress
true
if this instance represents a loopback address,
false
otherwise.public boolean isMCGlobal()
InetAddress
false
.
Valid IPv6 link-global multicast addresses are FFxE:/112 where x is a set of flags, and the additional 112 bits make up the global multicast address space.
Valid IPv4 global multicast addresses are between: 224.0.1.0 to 238.255.255.255.
isMCGlobal
in class InetAddress
true
if this instance represents a global multicast
address, false
otherwise.public boolean isMCLinkLocal()
InetAddress
false
.
Valid IPv6 link-local multicast addresses are FFx2:/112 where x is a set of flags, and the additional 112 bits make up the link-local multicast address space.
Valid IPv4 link-local addresses are between: 224.0.0.0 to 224.0.0.255
isMCLinkLocal
in class InetAddress
true
if this instance represents a link-local multicast
address, false
otherwise.public boolean isMCOrgLocal()
InetAddress
false
.
Valid IPv6 organization-local multicast addresses are FFx8:/112 where x is a set of flags, and the additional 112 bits make up the organization-local multicast address space.
Valid IPv4 organization-local addresses are between: 239.192.0.0 to 239.251.255.255
isMCOrgLocal
in class InetAddress
true
if this instance represents a organization-local
multicast address, false
otherwise.public boolean isMCSiteLocal()
InetAddress
false
.
Valid IPv6 site-local multicast addresses are FFx5:/112 where x is a set of flags, and the additional 112 bits make up the site-local multicast address space.
Valid IPv4 site-local addresses are between: 239.252.0.0 to 239.255.255.255
isMCSiteLocal
in class InetAddress
true
if this instance represents a site-local multicast
address, false
otherwise.public boolean isSiteLocalAddress()
InetAddress
false
.
Valid IPv6 site-local addresses are FEC0::0 through to FEFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF.
There are no valid IPv4 site-local addresses.
isSiteLocalAddress
in class InetAddress
true
if this instance represents a site-local address,
false
otherwise.