Here you can find the source of subarray(byte[] in, int arg1, int arg2)
public static byte[] subarray(byte[] in, int arg1, int arg2)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] subarray(byte[] in, int arg1, int arg2) { byte[] out = new byte[(arg2 - arg1) + 1]; if (arg2 - arg1 > in.length) { return in; }/*from www. ja va2 s . c o m*/ for (int i = arg1; i <= arg2; i++) { out[i - arg1] = in[i]; } return out; } }