| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.util.ArrayUtil |
Utility methods for arrays.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static final Object[] | NO_OBJECT | An empty immutable Object Object[] array. | |||||||||
| public static final String[] | NO_STRING | An empty immutable String String[] array. | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ArrayUtil() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static List<Character> | asList(char[] array) | ||||||||||
| static List<Float> | asList(float[] array) | ||||||||||
| static List<Double> | asList(double[] array) | ||||||||||
| static List<Boolean> | asList(boolean[] array) | ||||||||||
| static List<Integer> | asList(int[] array) | ||||||||||
| static List<Long> | asList(long[] array) | ||||||||||
| static List<Short> | asList(short[] array) | ||||||||||
| static List<Byte> | asList(byte[] array) | ||||||||||
| static int[] |
bytesToIntegers(byte[] input)
Convert a byte array to an int array with the same exact values (that means the bytes are
sign extended).
| ||||||||||
| static int |
compareBytes(byte[] array1, int pos1, byte[] array2, int pos2, int size)
Compare arrays of bytes.
| ||||||||||
| static void |
copyBytes(byte[] dst, int dstOffset, byte[] src, int srcOffset, int size)
Copy bytes from a source to a destination.
| ||||||||||
| static byte[] |
integersToBytes(int[] input)
Convert an int array into a byte array by casting all integers to bytes.
| ||||||||||
| static boolean |
isSled(byte[] array, byte value)
Check if an array contains a same repeated value.
| ||||||||||
| static int[] |
unsignedBytesToIntegers(byte[] input)
Convert an array of unsigned bytes to an array of integers.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
An empty immutable Object Object[] array.
An empty immutable String String[] array.
Convert a byte array to an int array with the same exact values (that means the bytes are sign extended).
| input | byte array |
|---|
Compare arrays of bytes. This method raises an ArrayIndexOutOfBoundsException exception if either one of the input arrays does not contain enough byts to be compared.
| array1 | first array |
|---|---|
| pos1 | where to start in the first array |
| array2 | second array |
| pos2 | where to start in the second array |
| size | number of bytes to be compared |
Copy bytes from a source to a destination. If the destination and source arrays are the same, potential overlaps are properly handled. This method does not validate bounds or arguments: NullPointerException and ArrayIndexOutOfBoundsException can be raised.
| dst | destination array |
|---|---|
| dstOffset | start offset in the destination array |
| src | source array source array, potentially the same as the destination array |
| srcOffset | start offset in the source array |
| size | number of bytes to be copied |
Convert an int array into a byte array by casting all integers to bytes.
| input | int array |
|---|
Check if an array contains a same repeated value.
| array | the array to be checked |
|---|---|
| value | the sled value |
Convert an array of unsigned bytes to an array of integers.
| input | byte array, for which the bytes are treated as unsigned |
|---|