Here you can find the source of subarray(byte[] text, int from, int to)
public static byte[] subarray(byte[] text, int from, int to)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] subarray(byte[] text, int from, int to) { int len = to - from; byte[] returnText = new byte[len]; for (int i = 0; i < len && i + from < text.length; i++) { returnText[i] = text[i + from]; }//from w w w. j av a 2 s .com return returnText; } }