Ipv4Address

object Ipv4Address extends Ipv4AddressCompanionPlatform
Companion
class
trait Ipv4AddressCompanionPlatform
class Object
trait Matchable
class Any

Value members

Concrete methods

def fromBytes(bytes: Array[Byte]): Option[Ipv4Address]

Constructs an IPv4 address from a 4-element byte array. Returns Some when array is exactly 4-bytes and None otherwise.

Constructs an IPv4 address from a 4-element byte array. Returns Some when array is exactly 4-bytes and None otherwise.

def fromBytes(a: Int, b: Int, c: Int, d: Int): Ipv4Address

Constructs an address from the specified 4 bytes.

Constructs an address from the specified 4 bytes.

Each byte is represented as an Int to avoid having to manually call .toByte on each value -- the toByte call is done inside this function.

def fromLong(value: Long): Ipv4Address

Constructs an IPv4 address from a Long, using the lower 32-bits.

Constructs an IPv4 address from a Long, using the lower 32-bits.

def fromString(value: String): Option[Ipv4Address]

Parses an IPv4 address from a dotted-decimal string, returning None if the string is not a valid IPv4 address.

Parses an IPv4 address from a dotted-decimal string, returning None if the string is not a valid IPv4 address.

def mask(bits: Int): Ipv4Address

Computes a mask by setting the first / left-most n bits high.

Computes a mask by setting the first / left-most n bits high.

Example
scala> Ipv4Address.mask(16)
res0: Ipv4Address = 255.255.0.0

Inherited methods

def fromInet4Address(address: Inet4Address): Ipv4Address

Converts the supplied Inet4Address to an Ipv4Address.

Converts the supplied Inet4Address to an Ipv4Address.

Inherited from
Ipv4AddressCompanionPlatform

Concrete fields

Last IP address in the IPv4 multicast range.

Last IP address in the IPv4 multicast range.

First IP address in the IPv4 multicast range.

First IP address in the IPv4 multicast range.

Last IP address in the IPv4 source specific multicast range.

Last IP address in the IPv4 source specific multicast range.

First IP address in the IPv4 source specific multicast range.

First IP address in the IPv4 source specific multicast range.