Thank you very much for the reply Holger. One more question though: I mentioned “stream” in my original question, because I thought that for very big files, “stream” had to be utilized when doing the conversion. Is your answer saying that this is not true and I should be able to utilize your answer regardless if the compressed file is gigantic (15 - 20 MB for instance)?
I would suggest loadAs = stream (for loading or extracting large file content) and down stream follow the steps that Holger mentioned and see if this makes a difference processing wise and make sure you drop the vars appropriately.
You’re right. For very big files, you should consider using streams instead of byte arrays. Now, whether 15MB is a really big file in today’s terms can be debated. It may be possible for you handle a file of that size as a byte array depending on how much memory you have and what else you have going on in your server at the time.
If you want to play it safe though, which I can certainly appreciate, you will likely have to create your own Java service(s) to base-64 encode a stream. Luckily, some of the hard work has been done for you already. Take a look at Base64OutputStream (Apache Commons Codec 1.15 API)