Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reading OutputStream in JSP  RSS feed

 
Rupa S
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i have an image generator class that generates a JPEG image on the fly, i dont want to store this image in a file.I want this class to write this image in to an OutputStream and at the same time my JSP should read this image from the OutputStream. My image generator class uses the com.sun.image.codec.jpeg API.
Please help.

Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your best bet is to create a servlet that can stream the file to the browser.
I've published a real simple one that streams files from the filesystem. It wouldn't take much effort to rework it to stream the image you've generated on the fly.
http://simple.souther.us
Look for SimpleStream.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!