I have a String which has already been base64 encoded. Now when this is marshalled in weblogic is get encoded again - which i dont want, So i which to decode the orignal base64 but yet keep it in a String format.
Is this possible ?
How do i do it ?
String image //already base64'dBase64 imageBase64 = new Base64();//currently if (image != null) { ImageData.setImageData(image.getBytes()); }//attempting if (image != null) {String newImage = image converted from base64 back to a String ImageData.setImageData(newImage.getBytes()); }
>>So i which to decode the orignal base64 but yet keep it in a String format. Is this possible?
Not really - since it wouldn't need Base64 encoding if it were a real string. Why can't you decode it as byte[]
Molko
ASKER
I probably didnt explain myself propery.
The string i have is already base64 encoded, I then do ImageData.setImageData(image.getBytes()); this is then sent through Weblogic which marshalls this into another byteArray - so it get encoded again.
In my code i have a base64 encoded String which i can paste into this tool http://www.4mhz.de/b64dec.html to give me a jpg.
Currenly i have :
String image //already base64'd
if (image != null) {
ImageData.setImageData(image.getBytes());
}
So in theory i need to do a getBytes on the decoded String, i'd guess decoding the String would give me some kind of blob in with which i need to call getBytes on ....
Does that sound correct ? How do i implement this ?
Any help greatly appreciated
CEHJ
Base64 *de*coding something encoded will already give you a byte array which you can use to set the image
Not really - since it wouldn't need Base64 encoding if it were a real string. Why can't you decode it as byte[]