private byte[] concat(final byte[] data1,final byte[] data2){
  final byte[] newdata=new byte[data1.length + data2.length];
  System.arraycopy(data1,0,newdata,0,data1.length);
  System.arraycopy(data2,0,newdata,data1.length,data2.length);
  return newdata;
}

private byte [ ] concat ( final byte [ ] data1 , final byte [ ] data2 ) { final byte [ ] newdata = new byte [ data1 . length + data2 . length ] ; System . arraycopy ( data1 , 0 , newdata , 0 , data1 . length ) ; System . arraycopy ( data2 , 0 , newdata , data1 . length , data2 . length ) ; return newdata ; }
concatenates two byte arrays .
