Java Array Combine combineChunksToByteArray(byte chunks[][])

Here you can find the source of combineChunksToByteArray(byte chunks[][])

Description

combine Chunks To Byte Array

License

Open Source License

Parameter

Parameter Description
chunks a parameter

Declaration

public static byte[] combineChunksToByteArray(byte chunks[][]) 

Method Source Code

//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;
    }
}

Related

  1. combineAlpha(float[] partsAlpha, int partsN)
  2. combineArrays(final Object[] array1, final Object[] array2, final Object[] targetArray)
  3. combineArrays(float[]... arrays)
  4. combineByteArray(byte[] one, byte[] two)
  5. combineChannels(int[][] a, int[][] r, int[][] g, int[][] b, int[][] pixels)
  6. combineComponent(float[] partsComponent, float[] partsAlpha, int partsN)
  7. combineIndices(String[] in, String delimiter, int i, int j)
  8. combineIntArrays(int[] A, int[] B)
  9. combineLines(String[] lines)