Here you can find the source of subset(byte[] a, int begin_index, int len)
public static byte[] subset(byte[] a, int begin_index, int len)
//package com.java2s; public class Main { public static byte[] subset(byte[] a, int begin_index, int len) { if (a == null) return null; if (begin_index < 0 || len <= 0 || begin_index >= a.length || len > a.length - begin_index) throw new IllegalArgumentException("Wrong arguments: array length:" + a.length + ", begin index:" + begin_index + ", subset length:" + len); byte[] b = new byte[len]; for (int i = 0; i < len; i++) { b[i] = a[i + begin_index];/*from w w w.j av a2 s . c o m*/ } return b; } }