public class InetAddressUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
formatAddress(StringBuilder buffer,
SocketAddress socketAddress)
Formats
SocketAddress as text. |
static String |
getCanonicalLocalHostName()
Returns canonical name (fully qualified domain name) of the localhost.
|
static boolean |
isIPv4Address(String input)
Checks whether the parameter is a valid IPv4 address
|
static boolean |
isIPv4MappedIPv64Address(String input) |
static boolean |
isIPv6Address(String input)
Checks whether the parameter is a valid IPv6 address (including compressed).
|
static boolean |
isIPv6HexCompressedAddress(String input)
Checks whether the parameter is a valid compressed IPv6 address
|
static boolean |
isIPv6StdAddress(String input)
Checks whether the parameter is a valid standard (non-compressed) IPv6 address
|
static boolean |
isIPv6URLBracketedAddress(String input)
Checks whether the parameter is a valid URL formatted bracketed IPv6 address (including compressed).
|
public static final byte IPV4
public static final byte IPV6
public static boolean isIPv4Address(String input)
input - the address string to check for validitypublic static boolean isIPv4MappedIPv64Address(String input)
public static boolean isIPv6StdAddress(String input)
input - the address string to check for validitypublic static boolean isIPv6HexCompressedAddress(String input)
input - the address string to check for validitypublic static boolean isIPv6Address(String input)
input - the address string to check for validitypublic static boolean isIPv6URLBracketedAddress(String input)
[::1].input - the address string to check for validitypublic static void formatAddress(StringBuilder buffer, SocketAddress socketAddress)
SocketAddress as text.public static String getCanonicalLocalHostName()
Copyright © 2023. All rights reserved.