public final class Inet4AddressUtil extends Object
Modifier and Type | Field and Description |
---|---|
static Inet4Address |
LOOPBACK_ADDRESS
The loopback address (127.0.0.1).
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
addressToBytes(int address)
Converts from an IPv4 address from an integer to a series of four bytes.
|
static int |
addressToInt(byte[] address)
Converts an IPv4 address from a series of four bytes to an integer.
|
static Inet4Address |
stringToInetAddress(String addressString)
Parses a string representing an IPv4 address.
|
public static final Inet4Address LOOPBACK_ADDRESS
public static int addressToInt(byte[] address)
address
- IPv4 address as a series of four bytes.public static byte[] addressToBytes(int address)
address
- IPv4 address as an integer.public static Inet4Address stringToInetAddress(String addressString)
addressString
- IPv4 address in typical notation (NNN.NNN.NNN.NNN).IllegalArgumentException
- if addressString
is not a valid IPv4 address.Copyright © 2014–2016 aquenos GmbH. All rights reserved.