| java.lang.Object com.sun.midp.crypto.Util
Util | public class Util (Code) | | This class defines some static utility methods.
|
Method Summary | |
public static void | checkBounds(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) Verifies that method parameters are correct. | public static byte[] | cloneArray(byte[] array) Creates a copy of byte array. | public static byte[] | cloneSubarray(byte[] array, int offset, int len) Creates a copy of byte array. | public static int | getInt(byte[] data, int offset) Returns 4 bytes from the buffer as integer value. | static String | hexEncode(byte[] b) Converts a byte array into a corresponding string of hexadecimal
digits. | public static byte[] | unpackBytes(String src) Unpacks data from string representation. | public static void | xorArrays(byte[] a, byte[] b) Performs an XOR operation of arrays elements. |
checkBounds | public static void checkBounds(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)(Code) | | Verifies that method parameters are correct.
NOTE: This method accepts too big outputOffset values - cipher
methods must throw ShortBufferException if there are output data.
Parameters: input - the input buffer Parameters: inputOffset - the offset in input where the inputstarts Parameters: inputLen - the input length Parameters: output - the buffer for the result Parameters: outputOffset - the offset in output where the resultis stored throws: IllegalArgumentException - if parameters are wrong. |
cloneArray | public static byte[] cloneArray(byte[] array)(Code) | | Creates a copy of byte array.
Parameters: array - the byte array to be copied the copy of the array |
cloneSubarray | public static byte[] cloneSubarray(byte[] array, int offset, int len)(Code) | | Creates a copy of byte array.
Parameters: array - the byte array to be copied Parameters: offset - where to begin Parameters: len - how many bytes to copy the copy of the array |
getInt | public static int getInt(byte[] data, int offset)(Code) | | Returns 4 bytes from the buffer as integer value.
Parameters: data - data array Parameters: offset - value offset the value |
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 |
unpackBytes | public static byte[] unpackBytes(String src)(Code) | | Unpacks data from string representation.
Parameters: src - packed data unpacked data |
xorArrays | public static void xorArrays(byte[] a, byte[] b)(Code) | | Performs an XOR operation of arrays elements. Results are placed
into the first array.
Parameters: a - the first array Parameters: b - the second array |
|
|