final class Utilities extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
(专用程序包) static char[] |
hexDigits |
private static String |
indent |
private static Pattern |
lineBreakPatern |
| 构造器和说明 |
|---|
Utilities() |
| 限定符和类型 | 方法和说明 |
|---|---|
(专用程序包) static List<SNIServerName> |
addToSNIServerNameList(List<SNIServerName> serverNames,
String hostname)
Puts
hostname into the serverNames list. |
(专用程序包) static String |
byte16HexString(int id) |
(专用程序包) static boolean |
getBooleanProperty(String propName,
boolean defaultValue)
Return the value of the boolean System property propName.
|
(专用程序包) static String |
indent(String source) |
(专用程序包) static String |
indent(String source,
String prefix) |
private static void |
rangeCheck(int arrayLength,
int fromIndex,
int toIndex)
Checks that
fromIndex and toIndex are in
the range and throws an exception if they aren't. |
private static SNIHostName |
rawToSNIHostName(String hostname)
Converts string hostname to
SNIHostName. |
(专用程序包) static byte[] |
toByteArray(BigInteger bi)
Utility method to convert a BigInteger to a byte array in unsigned
format as needed in the handshake messages.
|
(专用程序包) static String |
toHexString(byte b) |
(专用程序包) static String |
toHexString(byte[] bytes) |
(专用程序包) static String |
toHexString(long lv) |
static final char[] hexDigits
private static final Pattern lineBreakPatern
static List<SNIServerName> addToSNIServerNameList(List<SNIServerName> serverNames, String hostname)
hostname into the serverNames list.
If the serverNames does not look like a legal FQDN, it will
not be put into the returned list.
Note that the returned list does not allow duplicated name type.
SNIServerNameprivate static SNIHostName rawToSNIHostName(String hostname)
SNIHostName.
Note that to check whether a hostname is a valid domain name, we cannot use the hostname resolved from name services. For virtual hosting, multiple hostnames may be bound to the same IP address, so the hostname resolved from name services is not always reliable.
hostname - the raw hostnameSNIHostName, or null if the hostname does
not look like a FQDNstatic boolean getBooleanProperty(String propName, boolean defaultValue)
static String toHexString(byte b)
static String byte16HexString(int id)
static String toHexString(byte[] bytes)
static String toHexString(long lv)
static byte[] toByteArray(BigInteger bi)
private static void rangeCheck(int arrayLength,
int fromIndex,
int toIndex)
fromIndex and toIndex are in
the range and throws an exception if they aren't.Copyright © 2023. All rights reserved.