public byte[] concatenateArray(byte[][] arraycp){
  byte[] dest=new byte[arraycp.length * arraycp[0].length];
  int indx=0;
  for (int i=0; i < arraycp.length; i++) {
    System.arraycopy(arraycp[i],0,dest,indx,arraycp[i].length);
    indx=indx + arraycp[i].length;
  }
  return dest;
}

public byte [ ] concatenateArray ( byte [ ] [ ] arraycp ) { byte [ ] dest = new byte [ arraycp . length * arraycp [ 0 ] . length ] ; int indx = 0 ; for ( int i = 0 ; i < arraycp . length ; i ++ ) { System . arraycopy ( arraycp [ i ] , 0 , dest , indx , arraycp [ i ] . length ) ; indx = indx + arraycp [ i ] . length ; } return dest ; }
this method concatenates a 2 - dimensional byte array into a 1 - dimensional byte array
