How can I use one stream and save result to many places?

Posted by plasticrabbit on Stack Overflow See other posts from Stack Overflow or by plasticrabbit
Published on 2010-05-10T18:52:40Z Indexed on 2010/05/10 19:24 UTC
Read the original article Hit count: 188

Filed under:
|
|

I using servlet and Apache ServletFileUpload that provides stream to uploaded image. All I want to do is to store that image to db and also store resized (I using JAI) version to db.

How can I achieve this without saving image to drive. As I understand stream can be read only once. So I need to store whole image in memory? Is it expensive for performance? Or there are another way?

© Stack Overflow or respective owner

Related posts about java

Related posts about stream