posted 18 years ago
My application will connect to internet and get a huge image file, my problem is i was unable to save the image file to the RMS. My application will throw out of memory exception. Is't the byte[] byteArray; cannot store more than 64kb data? If that is the case how can i display images or video more than 64kb?
this is my sample code (http connection):
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream strmDataType = new DataOutputStream(baos);
for(int i =0 ; i < length ; i++ )
{
c = in.read();
strmDataType.writeByte(c);
}
strmDataType.flush();
byteArray = baos.toByteArray();
strmDataType.close();
baos.close();
strmDataType = null;
baos = null;
I will get "uncaught error: out of memory" when i try to download an image more than 80kb.
is't possible to contruct an image object more than 100kb?
myImage = Image.createImage(raw, 0, raw.length);
Thanks