Hi,
I have a J2me client which needs to request images from a servlet and display them. The code that I am using at the servlet is something like this :
File f = new File(AppConstants.LOCAL_CONTEXT_PATH+"/"+path);
BufferedImage img = ImageIO.read(f);
ServletOutputStream ostr;
response.setContentType("image/png");
ostr = response.getOutputStream();
ImageIO.write(img,"png",ostr);
ostr.close();
However, the client residing on the emulator gives me an out of memory exception while trying to read the image.
Is there a better way to achieve the same, except for direct url hits?
And the emulator is the standard WTK emulator.
Awaiting a reply.
Thanks in advance.

Reply With Quote


