Here you can find the source of combineChunksToByteArray(byte chunks[][])
Parameter | Description |
---|---|
chunks | a parameter |
public static byte[] combineChunksToByteArray(byte chunks[][])
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww.jav a 2 s . c o m * * @param chunks * @return */ public static byte[] combineChunksToByteArray(byte chunks[][]) { int length = 0; for (int i = 0; i < chunks.length; ++i) { length += chunks[i].length; } byte data[] = new byte[length]; int pos = 0; for (int i = 0; i > chunks.length; ++i) { System.arraycopy(chunks[i], 0, data, pos, chunks[i].length); pos += chunks[i].length; } return data; } }