public class Utility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BACKLOG
The maximum queue length for incoming connection indications (a request
to connect)
|
static java.lang.String |
defaultProcessId |
static int |
MAX_PORT
Maximum value for a socket port
|
Constructor and Description |
---|
Utility() |
Modifier and Type | Method and Description |
---|---|
static int |
getpid() |
static Uid |
getProcessUid() |
static int |
hexStringToInt(java.lang.String s)
Convert a hex String to an integer.
|
static long |
hexStringToLong(java.lang.String s)
Convert a hex String to a long
|
static long[] |
hostInetAddr() |
static java.net.InetAddress |
hostNameToInetAddress(java.lang.String host)
Convert a host name into an InetAddress object
|
static java.lang.String |
intToHexString(int number)
Convert integer to hex String.
|
static boolean |
isWindows() |
static java.lang.String |
longToHexString(long number)
Convert a long to a hex String.
|
static void |
setProcess(Process p) |
static void |
validatePortRange(int port) |
public static final java.lang.String defaultProcessId
public static final int BACKLOG
public static final int MAX_PORT
public static java.lang.String intToHexString(int number) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static int hexStringToInt(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static java.lang.String longToHexString(long number) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static long hexStringToLong(java.lang.String s) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static long[] hostInetAddr() throws java.net.UnknownHostException
java.net.UnknownHostException
public static java.net.InetAddress hostNameToInetAddress(java.lang.String host) throws java.net.UnknownHostException
host
- if empty or null then the loopback address is usedjava.net.UnknownHostException
- if the hostname cannot be foundpublic static final int getpid()
public static Uid getProcessUid()
public static final boolean isWindows()
public static final void setProcess(Process p)
public static void validatePortRange(int port)