Java Utililty Methods Array Sub Array

List of utility methods to do Array Sub Array

Description

The list of methods to do Array Sub Array are organized into topic(s).

Method

byte[]subArray(byte[] src, int pos, int length)
sub Array
if (src == null || src.length < length - pos) {
    throw new IllegalArgumentException();
byte[] result = new byte[length];
System.arraycopy(src, pos, result, 0, length);
return result;
byte[]subArray(byte[] src, int start)
sub Array
if (start == 0) {
    return src;
int length = src.length - start;
byte[] dest = new byte[length];
System.arraycopy(src, start, dest, 0, length);
return dest;
byte[]subArray(byte[] src, int start, int limit)
sub Array
byte[] buff = new byte[limit];
for (int i = 0; i < limit; i++) {
    buff[i] = src[start++];
return buff;
byte[]subarray(byte[] text, int from, int to)
subarray
int len = to - from;
byte[] returnText = new byte[len];
for (int i = 0; i < len && i + from < text.length; i++) {
    returnText[i] = text[i + from];
return returnText;
char[][]subarray(char[][] array, int start, int end)
subarray
if (end == -1)
    end = array.length;
if (start > end)
    return null;
if (start < 0)
    return null;
if (end > array.length)
    return null;
...
double[]subArray(double[] a, int begin, int end)
sub Array
double[] res = new double[end - begin];
for (int i = begin; i < end; i++) {
    res[i - begin] = a[i];
return res;
double[]subArray(double[] arr, int start, int fim)
sub Array
int lenght = fim - start + 1;
double[] janela = new double[lenght];
int counter = start;
for (int i = 0; i < lenght; i++) {
    janela[i] = arr[counter];
    counter++;
return janela;
...
double[]subArray(double[] array, int startIndex, int length)
sub Array
double[] result = new double[length];
System.arraycopy(array, startIndex, result, 0, length);
return result;
double[]subarray(double[] orig, int off, int len)
subarray
if (off + len > orig.length)
    throw new IllegalArgumentException("requested subarray exceeds array length");
double[] sub = new double[len];
System.arraycopy(orig, off, sub, 0, len);
return sub;
double[]subarray(double[] orig, int off, int len)
subarray
if (off + len > orig.length)
    throw new IllegalArgumentException("requested subarray exceeds array length");
double[] sub = new double[len];
System.arraycopy(orig, off, sub, 0, len);
return sub;