Some more information. I am populating the Stream using the .Write function but I don't want to store the Stream in a persistant fashion since I want it to be purged after the Java Binding Connection is closed. I have gotten the Encryption to work with a stream data length of around 28,000 characters. When I tried to run it for 48,000 characters I got the error in the above reply. Could this be some incarnation of a string length issue? I thought this would be avoided with the stream...
Another thing I've observed. I am playing with different length stream responses to see where things are getting hung up (and it does look like an infinite loop in the encryption functions as far as I can tell). At a size below the infinite loop length but above the working length I am seeing this error: <ILLEGAL VALUE>zAESCBCEncryptStream+17^%SYSTEM.Encryption.1 I am not sure why an error like this would be thrown for a function that works on a stream...
Just in case anyone else has this problem in the future, the cause was the fact that I was using the same input stream as my output stream (first two parameters of the function). Another thing I learned is that the block encryption is performed in blocks of 32,676 bytes. So if you are using this function you can use a buffer of that size for optimal performance on the receiving side.