Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] copyOfRange(byte[] from, int start, int end) { int length = end - start; byte[] result = new byte[length]; System.arraycopy(from, start, result, 0, length); return result; } }