Here you can find the source of copyByte(byte[] ASource, int nFrom, int nEnd)
public static byte[] copyByte(byte[] ASource, int nFrom, int nEnd)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] copyByte(byte[] ASource, int nFrom, int nEnd) { if (nEnd < nFrom) { return null; }/*ww w.j a v a2 s . c o m*/ if (nEnd >= ASource.length) { nEnd = ASource.length - 1; } int j = 0; byte[] sResult = new byte[nEnd - nFrom + 1]; for (int i = nFrom; i <= nEnd; i++) { sResult[j] = ASource[i]; j = j + 1; } return sResult; } }