java - ImageIO.write freezes after a while -


i have following code generates image used src of image element in html document:

bufferedimage iimage = (bufferedimage) camera.getimage(); servletoutputstream out = response.getoutputstream(); response.setcontenttype("image/jpeg"); imageoutputstream ios = imageio.createimageoutputstream(out); imageio.write(iimage, "jpg", ios); ios.close(); out.close(); 

the application deployed on apache tomcat. problem image freezing after while, think because of imageio.write, have tried use

imageio.setusecache(false); 

but no success.

my question is, there alternative?, why imageio freezing?, can prevent freezing?


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -