| java.lang.Object com.sun.midp.pki.Utils
Utils | public class Utils (Code) | | This class implements miscellaneous utility methods including
those used for conversion of BigIntegers to byte arrays,
hexadecimal printing of byte arrays etc.
|
Method Summary | |
public static boolean | byteMatch(byte[] a, int aOff, byte[] b, int bOff, int len) Checks if two byte arrays match. | public 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 ":". | public static String | hexEncode(byte[] b) Converts a byte array into a corresponding string of hexadecimal
digits. | public 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 ":". | public static byte[] | longToBytes(long n) Converts a long value to a cooresponding 8-byte array
starting with the most significant byte. |
byteMatch | public 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 | public 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 | public 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 | public 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 |
longToBytes | public 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 |
|
|