I agree that going though String is potentially dangerous, but...There is no Base64 encoder/decoder in the standard Java SDK class library !
There is Sun specific sun.misc.BASE64Encoder, but it is undocumented and generally can not be used.
You can use things like this:
Base64: Public Domain Base64 Encoder/Decoder