public static byte[] concatenate(byte[][] array){
  int rowLength=array[0].length;
  byte[] result=new byte[array.length * rowLength];
  int index=0;
  for (int i=0; i < array.length; i++) {
    System.arraycopy(array[i],0,result,index,rowLength);
    index+=rowLength;
  }
  return result;
}

public static byte [ ] concatenate ( byte [ ] [ ] array ) { int rowLength = array [ 0 ] . length ; byte [ ] result = new byte [ array . length * rowLength ] ; int index = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) { System . arraycopy ( array [ i ] , 0 , result , index , rowLength ) ; index += rowLength ; } return result ; }
convert a 2 - dimensional byte array into a 1 - dimensional byte array by concatenating all entries .
