I have problem, when i encode the image byte array with Base64 method. The Base64 i've use is from bouncy castle here: http://www.bouncycastle.org/java.html. The Base64 encode is return byte array. After i got the Base64 encode then i put it on the string. After that the error message: java.lang.OutOfMemoryError. I investigate, this is because the result of Base64 is too large. So, the String can not hold, and this is because the limit of KVM. For your information, i am developing application for S40 with J2ME. Somebody can help or give me advice to solve this issue...?.
Here is my code chunk
// this.sendImage is the byte array cause the encode returning the byte array.
this.sendImage = Base64.encode(sendImage);
String tmp = new String(sendImage);