public static byte[] concatenate(byte[] x1,byte[] x2){
  byte[] result=new byte[x1.length + x2.length];
  System.arraycopy(x1,0,result,0,x1.length);
  System.arraycopy(x2,0,result,x1.length,x2.length);
  return result;
}

public static byte [ ] concatenate ( byte [ ] x1 , byte [ ] x2 ) { byte [ ] result = new byte [ x1 . length + x2 . length ] ; System . arraycopy ( x1 , 0 , result , 0 , x1 . length ) ; System . arraycopy ( x2 , 0 , result , x1 . length , x2 . length ) ; return result ; }
concatenate two byte arrays . no null checks are performed .
