byte[] concatArrays(byte[]... arrays) {
        int length = 0;
        for (byte[] array : arrays) {
            if (array == null) {
                continue;
            }
            length += array.length;
        }
        byte[] result = new byte[length];
        int pos = 0;
        for (byte[] array : arrays) {
            if (array == null) {
                continue;
            }
            System.arraycopy(array, 0, result, pos, array.length);
            pos += array.length;
        }
        return result;
    }
Concatenates the given arrays into a single array.
common/src/test/java/org/conscrypt/javax/crypto/CipherBasicsTest.java