public static byte[] combine(final List<byte[]> dataChunks) {
    int totalSize = 0;

    for (final byte[] dataPart : dataChunks) {
      totalSize += dataPart.length;
    }

    final byte[] data = new byte[totalSize];

    int index = 0;

    for (final byte[] dataPart : dataChunks) {
      System.arraycopy(dataPart, 0, data, index, dataPart.length);

      index += dataPart.length;
    }

    return data;
  }
Combines a list of byte arrays into one big byte array.

@param dataChunks The list of byte arrays.
@return The one big byte array.
java/zylib/src/main/java/com/google/security/zynamics/zylib/general/ByteHelpers.java