| java.lang.Object com.sun.portal.kssl.Utils
Utils | class Utils (Code) | | This class implements miscellaneous utility methods including
those used for event logging, conversion of BigIntegers to
byte arrays, hexadecimal printing of byte arrays etc.
|
Field Summary | |
final static byte | LOG_CRIT Logging critical messages (5). | final static byte | LOG_DEBUG Logging debug messages (0). | final static byte | LOG_ERR Logging error messages (4). | final static byte | LOG_INFO Logging information messages (1). | final static byte | LOG_NOTICE Logging notice messages (2). | final static byte | LOG_WARN Logging warning messages (3). |
Method Summary | |
static byte[] | bigInt2Bytes(BigInteger bi) | static boolean | byteMatch(byte[] a, int aOff, byte[] b, int bOff, int len) Checks if two byte arrays match. | static String | hexEncode(byte[] b, int off, int len) Converts a subsequence of bytes in a byte array into a
corresponding string of hexadecimal digits, each separated by a ":". | static String | hexEncode(byte[] b) Converts a byte array into a corresponding string of hexadecimal
digits. | static char[] | hexEncodeToChars(byte[] b, int off, int len) Converts a subsequence of bytes in a byte array into a
corresponding string of hexadecimal digits, each separated by a ":". | static void | log(byte lev, String msg) Logs the specified string (without a trailing new-line
character) if the level specified equals or exceeds the
logging threshold level. | static void | logln(byte lev, String msg) Logs the specified string (with a trailing new-line
character) if the level specified equals or exceeds the
logging threshold level. | static byte[] | longToBytes(long n) Converts a long value to a cooresponding 8-byte array
starting with the most significant byte. |
LOG_CRIT | final static byte LOG_CRIT(Code) | | Logging critical messages (5).
|
LOG_DEBUG | final static byte LOG_DEBUG(Code) | | Logging debug messages (0).
|
LOG_ERR | final static byte LOG_ERR(Code) | | Logging error messages (4).
|
LOG_INFO | final static byte LOG_INFO(Code) | | Logging information messages (1).
|
LOG_NOTICE | final static byte LOG_NOTICE(Code) | | Logging notice messages (2).
|
LOG_WARN | final static byte LOG_WARN(Code) | | Logging warning messages (3).
|
byteMatch | static boolean byteMatch(byte[] a, int aOff, byte[] b, int bOff, int len)(Code) | | Checks if two byte arrays match.
Parameters: a - first byte array Parameters: aOff - starting offset for comparison within a Parameters: b - second byte array Parameters: bOff - starting offset for comparison within b Parameters: len - number of bytes to be compared true if the sequence of len bytes in a starting ataOff matches those in b starting at bOff, false otherwise |
hexEncode | static String hexEncode(byte[] b, int off, int len)(Code) | | Converts a subsequence of bytes in a byte array into a
corresponding string of hexadecimal digits, each separated by a ":".
Parameters: b - byte array containing the bytes to be converted Parameters: off - starting offset of the byte subsequence inside b Parameters: len - number of bytes to be converted a string of corresponding hexadecimal digits oran error string |
hexEncode | static String hexEncode(byte[] b)(Code) | | Converts a byte array into a corresponding string of hexadecimal
digits. This is equivalent to hexEncode(b, 0, b.length).
Parameters: b - byte array to be converted corresponding hexadecimal string |
hexEncodeToChars | static char[] hexEncodeToChars(byte[] b, int off, int len)(Code) | | Converts a subsequence of bytes in a byte array into a
corresponding string of hexadecimal digits, each separated by a ":".
Parameters: b - byte array containing the bytes to be converted Parameters: off - starting offset of the byte subsequence inside b Parameters: len - number of bytes to be converted a string of corresponding hexadecimal digits oran error string |
log | static void log(byte lev, String msg)(Code) | | Logs the specified string (without a trailing new-line
character) if the level specified equals or exceeds the
logging threshold level.
Parameters: lev - indicates criticality of message to be logged Parameters: msg - string containing message to be logged |
logln | static void logln(byte lev, String msg)(Code) | | Logs the specified string (with a trailing new-line
character) if the level specified equals or exceeds the
logging threshold level.
Parameters: lev - indicates criticality of message to be logged Parameters: msg - string containing message to be logged |
longToBytes | static byte[] longToBytes(long n)(Code) | | Converts a long value to a cooresponding 8-byte array
starting with the most significant byte.
Parameters: n - 64-bit long integer value a corresponding 8-byte array in network byte order |
|
|