Here you can find the source of subArray(byte[] input, int start)
Parameter | Description |
---|---|
input | the input byte array |
start | the start index |
public static byte[] subArray(byte[] input, int start)
//package com.java2s; public class Main { /**/*from w w w . j a va2 s.com*/ * Generate a subarray of a given byte array. * * @param input the input byte array * @param start the start index * @param end the end index * @return a subarray of <tt>input</tt>, ranging from <tt>start</tt> * (inclusively) to <tt>end</tt> (exclusively) */ public static byte[] subArray(byte[] input, int start, int end) { byte[] result = new byte[end - start]; System.arraycopy(input, start, result, 0, end - start); return result; } /** * Generate a subarray of a given byte array. * * @param input the input byte array * @param start the start index * @return a subarray of <tt>input</tt>, ranging from <tt>start</tt> to * the end of the array */ public static byte[] subArray(byte[] input, int start) { return subArray(input, start, input.length); } }