Package org.bouncycastle.util
Class Arrays
java.lang.Object
org.bouncycastle.util.Arrays
public final class Arrays extends Object
General array utilities.
-
Method Summary
Modifier and Type Method Description static booleanareEqual(boolean[] a, boolean[] b)static booleanareEqual(byte[] a, byte[] b)static booleanareEqual(char[] a, char[] b)static booleanareEqual(int[] a, int[] b)static booleanareEqual(long[] a, long[] b)static booleanareEqual(BigInteger[] a, BigInteger[] b)static byte[]clone(byte[] data)static byte[][]clone(byte[][] data)static byte[][][]clone(byte[][][] data)static int[]clone(int[] data)static short[]clone(short[] data)static BigInteger[]clone(BigInteger[] data)static byte[]concatenate(byte[] a, byte[] b)static byte[]concatenate(byte[] a, byte[] b, byte[] c)static byte[]concatenate(byte[] a, byte[] b, byte[] c, byte[] d)static booleanconstantTimeAreEqual(byte[] a, byte[] b)A constant time equals comparison - does not terminate early if test will fail.static byte[]copyOf(byte[] data, int newLength)static char[]copyOf(char[] data, int newLength)static int[]copyOf(int[] data, int newLength)static long[]copyOf(long[] data, int newLength)static BigInteger[]copyOf(BigInteger[] data, int newLength)static byte[]copyOfRange(byte[] data, int from, int to)static int[]copyOfRange(int[] data, int from, int to)static long[]copyOfRange(long[] data, int from, int to)static BigInteger[]copyOfRange(BigInteger[] data, int from, int to)static voidfill(byte[] array, byte value)static voidfill(char[] array, char value)static voidfill(int[] array, int value)static voidfill(long[] array, long value)static voidfill(short[] array, short value)static inthashCode(byte[] data)static inthashCode(char[] data)static inthashCode(int[] data)static inthashCode(int[][] ints)static inthashCode(short[] data)static inthashCode(short[][] shorts)static inthashCode(short[][][] shorts)static inthashCode(BigInteger[] data)
-
Method Details
-
areEqual
public static boolean areEqual(boolean[] a, boolean[] b) -
areEqual
public static boolean areEqual(char[] a, char[] b) -
areEqual
public static boolean areEqual(byte[] a, byte[] b) -
constantTimeAreEqual
public static boolean constantTimeAreEqual(byte[] a, byte[] b)A constant time equals comparison - does not terminate early if test will fail.- Parameters:
a- first arrayb- second array- Returns:
- true if arrays equal, false otherwise.
-
areEqual
public static boolean areEqual(int[] a, int[] b) -
areEqual
public static boolean areEqual(long[] a, long[] b) -
areEqual
-
fill
public static void fill(byte[] array, byte value) -
fill
public static void fill(char[] array, char value) -
fill
public static void fill(long[] array, long value) -
fill
public static void fill(short[] array, short value) -
fill
public static void fill(int[] array, int value) -
hashCode
public static int hashCode(byte[] data) -
hashCode
public static int hashCode(char[] data) -
hashCode
public static int hashCode(int[][] ints) -
hashCode
public static int hashCode(int[] data) -
hashCode
public static int hashCode(short[][][] shorts) -
hashCode
public static int hashCode(short[][] shorts) -
hashCode
public static int hashCode(short[] data) -
hashCode
-
clone
public static byte[] clone(byte[] data) -
clone
public static byte[][] clone(byte[][] data) -
clone
public static byte[][][] clone(byte[][][] data) -
clone
public static int[] clone(int[] data) -
clone
public static short[] clone(short[] data) -
clone
-
copyOf
public static byte[] copyOf(byte[] data, int newLength) -
copyOf
public static char[] copyOf(char[] data, int newLength) -
copyOf
public static int[] copyOf(int[] data, int newLength) -
copyOf
public static long[] copyOf(long[] data, int newLength) -
copyOf
-
copyOfRange
public static byte[] copyOfRange(byte[] data, int from, int to) -
copyOfRange
public static int[] copyOfRange(int[] data, int from, int to) -
copyOfRange
public static long[] copyOfRange(long[] data, int from, int to) -
copyOfRange
-
concatenate
public static byte[] concatenate(byte[] a, byte[] b) -
concatenate
public static byte[] concatenate(byte[] a, byte[] b, byte[] c) -
concatenate
public static byte[] concatenate(byte[] a, byte[] b, byte[] c, byte[] d)
-