Java tutorial
//package com.java2s; public class Main { public static byte[] cropByteArray(byte[] target, int offset, int length) { byte[] result = new byte[length]; System.arraycopy(target, offset, result, 0, (length)); return result; } }