@SuppressWarnings("MissingOverride")
    protected void engineUpdateAAD(ByteBuffer buf) {
        checkInitialization();
        int inputLen = buf.remaining();
        if (aadBuf == null) {
            aadBuf = new ExposedByteArrayOutputStream(inputLen);
            // Directly write the content of buf to aadBuf.array()
            buf.get(aadBuf.array(), 0, inputLen);
            aadBuf.setCountManually(inputLen);
            return;
        }
        byte[] input = new byte[inputLen];
        buf.get(input);
        aadBuf.write(input, 0, inputLen);
    }
AEAD buffers everything until a final output.
common/src/main/java/org/conscrypt/OpenSSLAeadCipher.java