toIPAddress

@JvmStatic
@JvmName(name = "get")
fun String.toIPAddress(): IPAddress(source)

Parses a String for its IPv4 or IPv6 address.

String can be either a URL containing the IP address, or the IPv4/IPv6 address itself.

Return

IPAddress

Throws

IllegalArgumentException

if no IP address is found


@JvmStatic
@JvmName(name = "get")
fun ByteArray.toIPAddress(): IPAddress(source)

Converts network ordered bytes to an IPv4 or IPv6 address.

Return

IPAddress

Throws

IllegalArgumentException

if array size is not 4 or 16.