private byte[] concat(byte[]... arrays){
  int lastPos=0;
  byte[] combined=new byte[combinedLength(arrays)];
  for (  byte[] array : arrays) {
    System.arraycopy(array,0,combined,lastPos,array.length);
    lastPos+=array.length;
  }
  return combined;
}

private byte [ ] concat ( byte [ ] ... arrays ) { int lastPos = 0 ; byte [ ] combined = new byte [ combinedLength ( arrays ) ] ; for ( byte [ ] array : arrays ) { System . arraycopy ( array , 0 , combined , lastPos , array . length ) ; lastPos += array . length ; } return combined ; }
utility to concat byte arrays
