Here you can find the source of getCopyByteArrayArray(byte[] src, int start, int length, int subArrayLength)
Parameter | Description |
---|---|
src | a parameter |
start | a parameter |
length | a parameter |
subArrayLength | a parameter |
public static byte[][] getCopyByteArrayArray(byte[] src, int start, int length, int subArrayLength)
//package com.java2s; public class Main { /**/*from www. ja v a 2s . c o m*/ * new byte[] { 8, 4, 2, 1 }, 0, 4, 2 => new byte[][]{{8,4}, {2,1}} * * @param src * @param start * @param length * @param subArrayLength * @return */ public static byte[][] getCopyByteArrayArray(byte[] src, int start, int length, int subArrayLength) { byte[][] dest = new byte[length / subArrayLength][subArrayLength]; byte[] temp = new byte[length]; System.arraycopy(src, start, temp, 0, length); for (int i = 0; i < dest.length; i++) { System.arraycopy(temp, i * subArrayLength, dest[i], 0, subArrayLength); } return dest; } }