List of utility methods to do Array Sub Array
T[] | subarray(T[] array, int startIndexInclusive, int endIndexExclusive) Produces a new array containing the elements between the start and end indices. The start index is inclusive, the end index exclusive. if (array == null) { return null; if (startIndexInclusive < 0) { startIndexInclusive = 0; if (endIndexExclusive > array.length) { endIndexExclusive = array.length; ... |
boolean[] | subarray(boolean[] array, int startIndexInclusive, int endIndexExclusive) Produces a new The start index is inclusive, the end index exclusive. if (array == null) { return null; if (startIndexInclusive < 0) { startIndexInclusive = 0; if (endIndexExclusive > array.length) { endIndexExclusive = array.length; ... |
byte[] | subarray(byte[] array, int startIndexInclusive, int endIndexExclusive) Produces a new The start index is inclusive, the end index exclusive. if (array == null) { return null; if (startIndexInclusive < 0) { startIndexInclusive = 0; if (endIndexExclusive > array.length) { endIndexExclusive = array.length; ... |
char[] | subarray(char[] array, int startIndexInclusive, int endIndexExclusive) Produces a new The start index is inclusive, the end index exclusive. if (array == null) { return null; if (startIndexInclusive < 0) { startIndexInclusive = 0; if (endIndexExclusive > array.length) { endIndexExclusive = array.length; ... |
double[] | subarray(double[] array, int startIndexInclusive, int endIndexExclusive) Produces a new The start index is inclusive, the end index exclusive. if (array == null) { return null; if (startIndexInclusive < 0) { startIndexInclusive = 0; if (endIndexExclusive > array.length) { endIndexExclusive = array.length; ... |
float[] | subarray(float[] array, int startIndexInclusive, int endIndexExclusive) Produces a new The start index is inclusive, the end index exclusive. if (array == null) { return null; if (startIndexInclusive < 0) { startIndexInclusive = 0; if (endIndexExclusive > array.length) { endIndexExclusive = array.length; ... |
int[] | subarray(int[] array, int startIndexInclusive, int endIndexExclusive) Produces a new The start index is inclusive, the end index exclusive. if (array == null) { return null; if (startIndexInclusive < 0) { startIndexInclusive = 0; if (endIndexExclusive > array.length) { endIndexExclusive = array.length; ... |
long[] | subarray(long[] array, int startIndexInclusive, int endIndexExclusive) Produces a new The start index is inclusive, the end index exclusive. if (array == null) { return null; if (startIndexInclusive < 0) { startIndexInclusive = 0; if (endIndexExclusive > array.length) { endIndexExclusive = array.length; ... |
short[] | subarray(short[] array, int startIndexInclusive, int endIndexExclusive) Produces a new The start index is inclusive, the end index exclusive. if (array == null) { return null; if (startIndexInclusive < 0) { startIndexInclusive = 0; if (endIndexExclusive > array.length) { endIndexExclusive = array.length; ... |
byte[] | subByteArray(byte[] array, int offset, int length) sub Byte Array int to = offset + length; if (to > array.length) to = array.length; return Arrays.copyOfRange(array, offset, to); |