Ipv6Address
Representation of an IPv6 address that works on both the JVM and Scala.js.
- Companion
- object
Value members
Methods
Converts this address to a string of form
each
Consecutive 0
x:x:x:x:x:x:a.b.c.d
whereeach
x
represents 16-bits and a.b.c.d
is IPv4 dotted decimal notation.Consecutive 0
x
fields are condensed with ::
.For example, the IPv4 address
IPv6 address via Ipv4Address#toCompatV6, which is represented as the string
127.0.0.1
can be converted to a compatibleIPv6 address via Ipv4Address#toCompatV6, which is represented as the string
::7f00:1
and the mixed string ::127.0.0.1
.Similarly,
resulting in
127.0.0.1
can be converted to a mapped V6 address via Ipv4Address#toMappedV6,resulting in
::ffff:7f00:1
and the mixed string ::ffff:127.0.0.1
.This format is described in RFC4291 section 2.2.3.
- Example
- {{{
scala> ipv6"::7f00:1".toMixedString
res0: String = ::127.0.0.1
scala> ipv6"ff3b:1234: :ffab:7f00:1".toMixedString
res0: String = ff3b:1234: :ffab:127.0.0.1
}}}
Gets the IPv6 address after this address, with overflow from
ffff:ffff:....:ffff
to ::
.- Definition Classes
Gets the IPv6 address before this address, with underflow from
::
to ffff:ffff:....:ffff
.- Definition Classes
Applies the supplied mask to this address.
- Example
- {{{
scala> ipv6"ff3b::1".masked(ipv6"fff0:: ")
res0: Ipv6Address = ff30::
}}}
Inherited methods
Converts this address to a source specific multicast address, as long as it is in the source specific multicast address range.
- Inhertied from
- IpAddress
override def toInetAddress: Inet6Address
- Definition Classes
- Ipv6AddressPlatform -> IpAddressPlatform
- Inhertied from
- Ipv6AddressPlatform
Converts this address to a multicast address, as long as it is in the multicast address range.
- Inhertied from
- IpAddress
Converts this address to a network order byte array of either 4 or 16 bytes.
- Inhertied from
- IpAddress