Package io.anyline.nfc.bouncycastle.util
Class Arrays
-
- All Implemented Interfaces:
public final class Arrays
General array utilities.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
Arrays.Iterator
Iterator backed by a specific array.
-
Method Summary
Modifier and Type Method Description static boolean
areAllZeroes(Array<byte> buf, int off, int len)
static boolean
areEqual(Array<boolean> a, Array<boolean> b)
static boolean
areEqual(Array<byte> a, Array<byte> b)
static boolean
areEqual(Array<byte> a, int aFromIndex, int aToIndex, Array<byte> b, int bFromIndex, int bToIndex)
static boolean
areEqual(Array<char> a, Array<char> b)
static boolean
areEqual(Array<int> a, Array<int> b)
static boolean
areEqual(Array<long> a, Array<long> b)
static boolean
areEqual(Array<Object> a, Array<Object> b)
static boolean
areEqual(Array<short> a, Array<short> b)
static boolean
constantTimeAreEqual(Array<byte> expected, Array<byte> supplied)
A constant time equals comparison - does not terminate early if test will fail. static boolean
constantTimeAreEqual(int len, Array<byte> a, int aOff, Array<byte> b, int bOff)
static int
compareUnsigned(Array<byte> a, Array<byte> b)
static boolean
contains(Array<boolean> a, boolean val)
static boolean
contains(Array<byte> a, byte val)
static boolean
contains(Array<char> a, char val)
static boolean
contains(Array<int> a, int val)
static boolean
contains(Array<long> a, long val)
static boolean
contains(Array<short> a, short val)
static void
fill(Array<boolean> a, boolean val)
static void
fill(Array<boolean> a, int fromIndex, int toIndex, boolean val)
static void
fill(Array<byte> a, byte val)
static void
fill(Array<byte> a, int fromIndex, int toIndex, byte val)
static void
fill(Array<char> a, char val)
static void
fill(Array<char> a, int fromIndex, int toIndex, char val)
static void
fill(Array<int> a, int val)
static void
fill(Array<int> a, int fromIndex, int toIndex, int val)
static void
fill(Array<long> a, long val)
static void
fill(Array<long> a, int fromIndex, int toIndex, long val)
static void
fill(Array<Object> a, Object val)
static void
fill(Array<Object> a, int fromIndex, int toIndex, Object val)
static void
fill(Array<short> a, short val)
static void
fill(Array<short> a, int fromIndex, int toIndex, short val)
static int
hashCode(Array<byte> data)
static int
hashCode(Array<byte> data, int off, int len)
static int
hashCode(Array<char> data)
static int
hashCode(Array<Array<int>> ints)
static int
hashCode(Array<int> data)
static int
hashCode(Array<int> data, int off, int len)
static int
hashCode(Array<long> data)
static int
hashCode(Array<long> data, int off, int len)
static int
hashCode(Array<Array<Array<short>>> shorts)
static int
hashCode(Array<Array<short>> shorts)
static int
hashCode(Array<short> data)
static int
hashCode(Array<Object> data)
static Array<boolean>
clone(Array<boolean> data)
static Array<byte>
clone(Array<byte> data)
static Array<char>
clone(Array<char> data)
static Array<int>
clone(Array<int> data)
static Array<long>
clone(Array<long> data)
static Array<short>
clone(Array<short> data)
static Array<BigInteger>
clone(Array<BigInteger> data)
static Array<byte>
clone(Array<byte> data, Array<byte> existing)
static Array<long>
clone(Array<long> data, Array<long> existing)
static Array<Array<byte>>
clone(Array<Array<byte>> data)
static Array<Array<Array<byte>>>
clone(Array<Array<Array<byte>>> data)
static Array<boolean>
copyOf(Array<boolean> original, int newLength)
static Array<byte>
copyOf(Array<byte> original, int newLength)
static Array<char>
copyOf(Array<char> original, int newLength)
static Array<int>
copyOf(Array<int> original, int newLength)
static Array<long>
copyOf(Array<long> original, int newLength)
static Array<short>
copyOf(Array<short> original, int newLength)
static Array<BigInteger>
copyOf(Array<BigInteger> original, int newLength)
static Array<boolean>
copyOfRange(Array<boolean> original, int from, int to)
static Array<byte>
copyOfRange(Array<byte> original, int from, int to)
Make a copy of a range of bytes from the passed in array. static Array<char>
copyOfRange(Array<char> original, int from, int to)
static Array<int>
copyOfRange(Array<int> original, int from, int to)
static Array<long>
copyOfRange(Array<long> original, int from, int to)
static Array<short>
copyOfRange(Array<short> original, int from, int to)
static Array<BigInteger>
copyOfRange(Array<BigInteger> original, int from, int to)
static Array<byte>
append(Array<byte> a, byte b)
static Array<short>
append(Array<short> a, short b)
static Array<int>
append(Array<int> a, int b)
static Array<String>
append(Array<String> a, String b)
static Array<byte>
concatenate(Array<byte> a, Array<byte> b)
static Array<short>
concatenate(Array<short> a, Array<short> b)
static Array<byte>
concatenate(Array<byte> a, Array<byte> b, Array<byte> c)
static Array<byte>
concatenate(Array<byte> a, Array<byte> b, Array<byte> c, Array<byte> d)
static Array<byte>
concatenate(Array<Array<byte>> arrays)
static Array<int>
concatenate(Array<int> a, Array<int> b)
static Array<byte>
prepend(Array<byte> a, byte b)
static Array<short>
prepend(Array<short> a, short b)
static Array<int>
prepend(Array<int> a, int b)
static Array<byte>
reverse(Array<byte> a)
static Array<int>
reverse(Array<int> a)
static Array<byte>
reverseInPlace(Array<byte> a)
static Array<int>
reverseInPlace(Array<int> a)
static void
clear(Array<byte> data)
Fill input array by zeros static void
clear(Array<int> data)
static boolean
isNullOrContainsNull(Array<Object> array)
static boolean
isNullOrEmpty(Array<byte> array)
static boolean
isNullOrEmpty(Array<int> array)
static boolean
isNullOrEmpty(Array<Object> array)
-
-
Method Detail
-
areAllZeroes
static boolean areAllZeroes(Array<byte> buf, int off, int len)
-
areEqual
static boolean areEqual(Array<byte> a, int aFromIndex, int aToIndex, Array<byte> b, int bFromIndex, int bToIndex)
-
constantTimeAreEqual
static boolean constantTimeAreEqual(Array<byte> expected, Array<byte> supplied)
A constant time equals comparison - does not terminate early if test will fail. For best results always pass the expected value as the first parameter.
- Parameters:
expected
- first arraysupplied
- second array- Returns:
true if arrays equal, false otherwise.
-
constantTimeAreEqual
static boolean constantTimeAreEqual(int len, Array<byte> a, int aOff, Array<byte> b, int bOff)
-
compareUnsigned
static int compareUnsigned(Array<byte> a, Array<byte> b)
-
clone
static Array<BigInteger> clone(Array<BigInteger> data)
-
copyOf
static Array<BigInteger> copyOf(Array<BigInteger> original, int newLength)
-
copyOfRange
static Array<boolean> copyOfRange(Array<boolean> original, int from, int to)
-
copyOfRange
static Array<byte> copyOfRange(Array<byte> original, int from, int to)
Make a copy of a range of bytes from the passed in array. The range can extend beyond the end of the input array, in which case the returned array will be padded with zeroes.
- Parameters:
original
- the array from which the data is to be copied.from
- the start index at which the copying should take place.to
- the final index of the range (exclusive).- Returns:
a new byte array containing the range given.
-
copyOfRange
static Array<char> copyOfRange(Array<char> original, int from, int to)
-
copyOfRange
static Array<int> copyOfRange(Array<int> original, int from, int to)
-
copyOfRange
static Array<long> copyOfRange(Array<long> original, int from, int to)
-
copyOfRange
static Array<short> copyOfRange(Array<short> original, int from, int to)
-
copyOfRange
static Array<BigInteger> copyOfRange(Array<BigInteger> original, int from, int to)
-
concatenate
static Array<byte> concatenate(Array<byte> a, Array<byte> b)
-
concatenate
static Array<short> concatenate(Array<short> a, Array<short> b)
-
concatenate
static Array<byte> concatenate(Array<byte> a, Array<byte> b, Array<byte> c)
-
concatenate
static Array<byte> concatenate(Array<byte> a, Array<byte> b, Array<byte> c, Array<byte> d)
-
concatenate
static Array<byte> concatenate(Array<Array<byte>> arrays)
-
concatenate
static Array<int> concatenate(Array<int> a, Array<int> b)
-
reverseInPlace
static Array<byte> reverseInPlace(Array<byte> a)
-
reverseInPlace
static Array<int> reverseInPlace(Array<int> a)
-
isNullOrContainsNull
static boolean isNullOrContainsNull(Array<Object> array)
-
isNullOrEmpty
static boolean isNullOrEmpty(Array<byte> array)
-
isNullOrEmpty
static boolean isNullOrEmpty(Array<int> array)
-
isNullOrEmpty
static boolean isNullOrEmpty(Array<Object> array)
-
-
-
-