byte[] concatenateByteArrays(byte[]... byteArrays) throws IOException {
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
  for (  byte[] array : byteArrays) {
    outputStream.write(array);
  }
  return outputStream.toByteArray();
}

byte [ ] concatenateByteArrays ( byte [ ] ... byteArrays ) throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; for ( byte [ ] array : byteArrays ) { outputStream . write ( array ) ; } return outputStream . toByteArray ( ) ; }
concatenates multiple bytearrays into one byte [ ]
