public static byte[] concat(byte[]... chunks) throws GeneralSecurityException {
    int length = 0;
    for (byte[] chunk : chunks) {
      if (length > Integer.MAX_VALUE - chunk.length) {
        throw new GeneralSecurityException("exceeded size limit");
      }
      length += chunk.length;
    }
    byte[] res = new byte[length];
    int pos = 0;
    for (byte[] chunk : chunks) {
      System.arraycopy(chunk, 0, res, pos, chunk.length);
      pos += chunk.length;
    }
    return res;
  }
Returns the concatenation of the input arrays in a single array. For example, {@code concat(new
byte[] {a, b}, new byte[] {}, new byte[] {c}} returns the array {@code {a, b, c}}.

@return a single array containing all the values from the source arrays, in order
java_src/src/main/java/com/google/crypto/tink/subtle/Bytes.java