static int[] subArray(int[] b, int start, int end) { int[] x = new int[end-start]; System.arraycopy(b, start, x, 0, end-start); ret x; } meta-for byte also as long { static byte[] subArray(byte[] b, int start, int end) { start = max(start, 0); end = min(end, l(b)); if (start >= end) ret new byte[0]; byte[] x = new byte[end-start]; System.arraycopy(b, start, x, 0, end-start); ret x; } } static short[] subArray(short[] b, int start, int end) { if (start <= 0 && end >= l(b)) ret b; short[] x = new short[end-start]; System.arraycopy(b, start, x, 0, end-start); ret x; } static float[] subArray(float[] b, int start, int end) { float[] x = new float[end-start]; System.arraycopy(b, start, x, 0, end-start); ret x; } static O[] subArray(O[] b, int start) { ret subArray(b, start, l(b)); } static O[] subArray(O[] b, int start, int end) { start = max(start, 0); end = min(end, l(b)); if (start >= end) ret new O[0]; O[] x = new O[end-start]; System.arraycopy(b, start, x, 0, end-start); ret x; }