Module inet.ipaddr

Class IPv6Address

All Implemented Interfaces:
AddressComponent, AddressSegmentSeries, AddressComponentRange, AddressDivisionSeries, AddressItem, AddressItemRange, IPAddressDivisionSeries, IPAddressRange, AddressStringDivisionSeries, IPAddressStringDivisionSeries, IPAddressSegmentSeries, Serializable, Comparable<AddressItem>, Iterable<IPv6Address>

public class IPv6Address extends IPAddress implements Iterable<IPv6Address>
An IPv6 address, or a subnet of multiple IPv6 addresses. Each segment can represent a single value or a range of values.

You can construct an IPv6 address from a byte array, from a BigInteger, from a Address.SegmentValueProvider, from Inet6Address, from MACAddress, from an IPv6AddressSection of 8 segments, or from an array of 8 IPv6AddressSegment objects.

To construct one from a String use IPAddressString.toAddress() or IPAddressString.getAddress(), IPAddressString.toHostAddress() or IPAddressString.getHostAddress()

An IPv6 address can have an associated zone, typically either a network interface name or a positive integer. An IPv6 zone distinguishes two IPv6 addresses that are the same.

  • They are used with link-local addresses fe80::/10 to distinguish two interfaces to the link-local network, this is known as the zone id.
  • They are used with site-local addresses to distinguish sites, using the site id, also known as the scope id.

A zone that consists of a scope id is called a scoped zone.

Author:
sfoley
See Also: