Singleton IPAddress for the local loop address.
Get a list of all IPAddress objects for a given host
name, based on whatever name service is configured for the running
system.
Get a list of all IPAddress objects for a given host
name, based on whatever name service is configured for the running
system.
The host name can either be a machine name, such as "www.clapper.org", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked.
If the host is null, then this method return an IPAddress
representing an address of the loopback interfaced. See RFC 3330
section 2 and RFC 2373 section 2.5.3.
This method corresponds to the getAllByName() method in
the java.net.InetAddress class.
the host name
the list of matching IPAddress objects
unknown host
Create an IPAddress, given a host name.
Create an IPAddress, given a host name.
the host name
the corresponding IPAddress object.
unknown host
Create an IPAddress, given a list of bytes representing the
address
Create an IPAddress, given a list of bytes representing the
address
- If the array has fewer than four values, it is assumed to be
an IPv4 address, and it will be padded with 0s to 4 bytes.
- If the array has between four and 16 values, it is assumed to be
an IPv6 address, and it will be padded with 0s to 16 bytes.
- Anything else will cause an IllegalArgumentException to be thrown.
Example of use:
val ip = IPAddress(List(192, 168, 1, 100))
the list of address values
the IPAddress
Create an IPAddress, given 1 to 16 integer arguments.
Create an IPAddress, given 1 to 16 integer arguments.
The integers will be truncated to 8-bit bytes.
- If the array has fewer than four values, it is assumed to be
an IPv4 address, and it will be padded with 0s to 4 bytes.
- If the array has between four and 16 values, it is assumed to be
an IPv6 address, and it will be padded with 0s to 16 bytes.
- Anything else will cause an IllegalArgumentException to be thrown.
Example of use:
val ip = IPAddress(Array(192, 168, 1, 100))
the bytes (as integers) of the address
the IPAddress
Create an IPAddress, given an array of integers representing
the address.
Create an IPAddress, given an array of integers representing
the address. The array must contain between 1 and 16 integer values.
The integers will be truncated to 8-bit bytes.
- If the array has fewer than four values, it is assumed to be
an IPv4 address, and it will be padded with 0s to 4 bytes.
- If the array has between four and 16 values, it is assumed to be
an IPv6 address, and it will be padded with 0s to 16 bytes.
- Anything else will cause an IllegalArgumentException to be thrown.
Example of use:
val ip = IPAddress(Array(192, 168, 1, 100))
the address
the corresponding IPAddress object.
Create an IPAddress, given an array of bytes representing
the address.
Create an IPAddress, given an array of bytes representing
the address. The array must contain between 1 and 16 byte values.
- If the array has fewer than four values, it is assumed to be
an IPv4 address, and it will be padded with 0s to 4 bytes.
- If the array has between four and 16 values, it is assumed to be
an IPv6 address, and it will be padded with 0s to 16 bytes.
- Anything else will cause an IllegalArgumentException to be thrown.
the address
the IPAddress
Implicitly converts a java.net.InetAddress to an
IPAddress.
Implicitly converts a java.net.InetAddress to an
IPAddress.
the java.net.InetAddress
the corresponding IPAddress
Implicitly converts an IPAddress to a
java.net.InetAddress.
Implicitly converts an IPAddress to a
java.net.InetAddress.
the IPAddress
the corresponding java.net.InetAddress
Companion object to
IPAddressclass.