java.lang.Object | |
↳ | android.net.IpPrefix |
This class represents an IP prefix, i.e., a contiguous block of IP addresses aligned on a power of two boundary (also known as an "IP subnet"). A prefix is specified by two pieces of information:
192.0.2.0/24
covers the 256 IPv4 addresses from
192.0.2.0
to 192.0.2.255
, inclusive, and the prefix
2001:db8:1:2
covers the 2^64 IPv6 addresses from 2001:db8:1:2::
to
2001:db8:1:2:ffff:ffff:ffff:ffff
, inclusive.
Objects of this class are immutable.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR | Implement the Parcelable interface. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Implement the Parcelable interface.
| |||||||||||
Compares this
IpPrefix object against the specified object in obj .
| |||||||||||
Returns a copy of the first IP address in the prefix.
| |||||||||||
Returns the prefix length of this
IpPrefix .
| |||||||||||
Returns a copy of the IP address bytes in network order (the highest order byte is the zeroth
element).
| |||||||||||
Gets the hashcode of the represented IP prefix.
| |||||||||||
Returns a string representation of this
IpPrefix .
| |||||||||||
Implement the Parcelable interface.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
Implement the Parcelable interface.
Implement the Parcelable interface.
Compares this IpPrefix
object against the specified object in obj
. Two
objects are equal if they have the same startAddress and prefixLength.
obj | the object to be tested for equality. |
---|
true
if both objects are equal, false
otherwise.
Returns a copy of the first IP address in the prefix. Modifying the returned object does not change this object's contents.
Returns the prefix length of this IpPrefix
.
Returns a copy of the IP address bytes in network order (the highest order byte is the zeroth element). Modifying the returned array does not change this object's contents.
Gets the hashcode of the represented IP prefix.
Returns a string representation of this IpPrefix
.
"192.0.2.0/24"
or "2001:db8:1:2::/64"
.
Implement the Parcelable interface.
dest | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|