public class IPv6Address extends IPAddress implements java.lang.Comparable<IPv6Address>
| Modifier and Type | Class and Description |
|---|---|
static class |
IPv6Address.IPv6KnownRange |
protected static class |
IPv6Address.LongByte
Enum for extracting bytes from 64-bit longs
|
protected static class |
IPv6Address.LongShort
Enum for extracting 16-bit shorts from 64-bit longs
|
| Modifier and Type | Field and Description |
|---|---|
static int |
ADDRESS_BITS |
static int |
ADDRESS_BYTES |
static int |
ADDRESS_SHORTS |
static int |
HOLDER_BITS |
protected long |
lower |
protected long |
upper |
| Constructor and Description |
|---|
IPv6Address(long upper,
long lower)
Build an IPv6Address from two longs - upper and lower 64 bits in form of
longs
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(IPv6Address o) |
boolean |
equals(java.lang.Object obj) |
long |
getLower()
return lower 64 bits of the address in long form
|
long |
getUpper()
return upper 64 bits of the address in long form
|
int |
hashCode() |
boolean |
is6To4()
Checks whether the given address is a 6to4 address
|
boolean |
isGlobalUnicast()
Is this an IPv6 global unicast address?
|
protected static boolean |
isHexDigit(char c) |
boolean |
isIPv4Translation()
Is this one of the IPv6 addresses reserved for IPv4-IPv6 translation -
Teredo, IPv4-mapped-IPv6, 6to4, or IPv4-embedded-IPv6?
|
boolean |
isLinkLocal()
Checks whether the address is link-local
|
boolean |
isLoopback()
Checks whether the address is a loopback address
|
boolean |
isMartian()
Martian addresses are reserved and private addresses that should not
appear on the public internet
|
boolean |
isMulticast()
Checks whether the address is part of a range reserved for multicast
|
boolean |
isPrivate()
Checks whether the address is private
|
boolean |
isReserved()
Checks whether the address part of a reserved range
|
boolean |
isUnspecified()
Checks whether the address is "unspecified"
|
boolean |
isZoned()
does this address have a specific zone?
|
protected int |
longCompare(IPv6Address o) |
IPv6Address |
minus(int n)
Return an address smaller than the current one by n, with wraparound
|
IPv6Address |
minus(long n)
Return an address smaller than the current one by n, with wraparound
|
IPv6Address |
next()
Returns the following address, with wraparound
|
static IPv6Address |
of(byte[] bigEndianByteArr)
Build an IPv6Address from a 16 byte long big-endian (highest byte first)
byte array
|
static IPv6Address |
of(java.net.Inet6Address address)
Build an IPv6Address from an Inet6Address
|
static IPv6Address |
of(long upper,
long lower)
Build an IPv6Address from two longs - upper and lower 64 bits in form of
longs
|
static IPv6Address |
of(java.lang.String address)
Build an IPv6Address or a ZonedIPv6Address from a literal IPv6 address in
String from such as "2001:1:2:3:4:5:6:7", "2001::", "[::]",
"fe80::1%eth0", and similar valid forms
|
IPv6Address |
plus(int n)
Return an address larger than the current one by n, with wraparound
|
IPv6Address |
plus(long n)
Return an address larger than the current one by n, with wraparound
|
IPv6Address |
previous()
Returns the previous address, with wraparound
|
byte[] |
toBigEndianArray()
The address as an array of bytes, with the highest byte first
|
java.net.Inet6Address |
toInet6Address() |
byte[] |
toLittleEndianArray()
The address as an array of bytes, with the highest byte last
|
java.lang.String |
toString() |
protected static int |
unsignedCompare(long a,
long b) |
protected static void |
verifyArray(byte[] bigEndianByteArr) |
int |
version()
Returns the version of the IP address
|
of, toArray, toBigInteger, toInetAddress, toSignedBigIntegerpublic static final int ADDRESS_BITS
public static final int ADDRESS_BYTES
public static final int ADDRESS_SHORTS
public static final int HOLDER_BITS
protected final long upper
protected final long lower
public IPv6Address(long upper,
long lower)
upper - upper 64 bits of the IPv6Addresslower - lower 64 bits of the IPv6Addresspublic static IPv6Address of(long upper, long lower)
upper - upper 64 bits of the IPv6Addresslower - lower 64 bits of the IPv6Addressprotected static void verifyArray(byte[] bigEndianByteArr)
public static IPv6Address of(byte[] bigEndianByteArr)
bigEndianByteArr - 16 byte big-endian byte arraypublic static IPv6Address of(java.net.Inet6Address address)
address - public static IPv6Address of(java.lang.String address)
address - protected static boolean isHexDigit(char c)
protected static int unsignedCompare(long a,
long b)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic long getUpper()
public long getLower()
public boolean is6To4()
IPAddresspublic boolean isMartian()
IPAddresspublic boolean isIPv4Translation()
public boolean isLoopback()
IPAddressisLoopback in class IPAddresspublic boolean isGlobalUnicast()
public boolean isLinkLocal()
IPAddressisLinkLocal in class IPAddresspublic boolean isMulticast()
IPAddressisMulticast in class IPAddresspublic boolean isPrivate()
IPAddresspublic boolean isReserved()
IPAddressisReserved in class IPAddresspublic boolean isUnspecified()
IPAddressisUnspecified in class IPAddresspublic IPv6Address next()
IPAddresspublic IPv6Address plus(long n)
n - public IPv6Address plus(int n)
IPAddresspublic IPv6Address previous()
IPAddresspublic IPv6Address minus(int n)
IPAddresspublic IPv6Address minus(long n)
n - public byte[] toBigEndianArray()
IPAddresstoBigEndianArray in class IPAddresspublic byte[] toLittleEndianArray()
IPAddresstoLittleEndianArray in class IPAddresspublic int compareTo(IPv6Address o)
compareTo in interface java.lang.Comparable<IPv6Address>protected int longCompare(IPv6Address o)
public java.net.Inet6Address toInet6Address()
public java.lang.String toString()
toString in class java.lang.Objectpublic int version()
IPAddresspublic boolean isZoned()