Here you can find the source of trimBytes(byte[] source, int fromIndex, int toIndex)
public static byte[] trimBytes(byte[] source, int fromIndex, int toIndex)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { public static byte[] trimBytes(byte[] source, int fromIndex, int toIndex) { int from = source.length - toIndex; int to = source.length - fromIndex; return Arrays.copyOfRange(source, from, to); }//from w w w. j a v a 2 s. c o m }