I want to decode a Base64 encoded file. I did a Google search and the easiest-to-use library seemed to be two Java classes, so I decided to do my app in Java.

I want to read a Outlook Express 4 mail file, where parts are encoded and others are not. I'm currently reading in the whole file, converting it to a string and searching for encoded blocks. Works great, finds the blocks correctly.
Now my problem: I end up with a String object named base64 which contains the encoded string. The decoding class is derived from FilterInputStream and expects an InputStream object passed to the constructor. But the only InputStream I can see that handles strings is StringInputString which is deprecated and saim the String directlyd to behave incorrectly. You should obviously use StringReader to read from strings.
My question: how can I get some kind of InputStream object, either fro or from StringReader?

For the time being I'll convert the String to a byte array and use a ByteArrayInputStream, but this is notoriously inefficient!

Thx in advance for any help.