Android Byte Array Merge byteMerge(byte[][] inp)

Here you can find the source of byteMerge(byte[][] inp)

Description

byte Merge

Declaration

public static final byte[] byteMerge(byte[][] inp) 

Method Source Code

//package com.java2s;

public class Main {
    public static final byte[] byteMerge(byte[][] inp) {
        int length = 0;
        if (inp == null)
            return null;
        for (int inx = 0; inx < inp.length; inx++) {
            if (inp[inx] == null)
                return null;
            length += inp[inx].length;//from  w  w  w .  j  a  va2 s  . co m
        }

        int position = 0;
        byte[] merge = new byte[length];
        for (int inx = 0; inx < inp.length; inx++) {
            for (int jnx = 0; jnx < inp[inx].length; jnx++) {
                merge[position++] = inp[inx][jnx];
            }
        }

        return merge;
    }
}

Related

  1. concat(byte[] b1, byte[] b2)
  2. byteMerger(byte[] byte_1, byte[] byte_2)