public class Utility extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BACKLOG
The maximum queue length for incoming connection indications (a request
to connect)
|
static int |
MAX_PORT
Maximum value for a socket port
|
| Constructor and Description |
|---|
Utility() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getDefaultProcessId() |
static int |
getpid() |
static Uid |
getProcessUid() |
static int |
hexStringToInt(String s)
Convert a hex String to an integer.
|
static long |
hexStringToLong(String s)
Convert a hex String to a long
|
static long[] |
hostInetAddr() |
static InetAddress |
hostNameToInetAddress(String host)
Convert a host name into an InetAddress object
|
static String |
intToHexString(int number)
Convert integer to hex String.
|
static boolean |
isAndroid() |
static boolean |
isWindows() |
static String |
longToHexString(long number)
Convert a long to a hex String.
|
static void |
setProcess(Process p) |
static void |
validatePortRange(int port) |
public static final int BACKLOG
public static final int MAX_PORT
public static String intToHexString(int number) throws NumberFormatException
NumberFormatExceptionpublic static int hexStringToInt(String s) throws NumberFormatException
NumberFormatExceptionpublic static String longToHexString(long number) throws NumberFormatException
NumberFormatExceptionpublic static long hexStringToLong(String s) throws NumberFormatException
NumberFormatExceptionpublic static long[] hostInetAddr()
throws UnknownHostException
UnknownHostExceptionpublic static InetAddress hostNameToInetAddress(String host) throws UnknownHostException
host - if empty or null then the loopback address is usedUnknownHostException - 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)
public static String getDefaultProcessId()
public static boolean isAndroid()
Copyright © 2012. All Rights Reserved.