-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Blobs, file upload, and preprocessing file in mid stream
PostPosted: Wed Sep 10, 2008 7:46 pm 
Newbie

Joined: Thu Oct 25, 2007 5:24 pm
Posts: 12
Hi,
my problem is trying to modify a stream from a file upload before Hibernate writes the blob into the database.
Code:
public void setDataContent( InputStream sourceStream )throws IOException{
   Blob image = Hibernate.createBlob( sourceStream ) );   
}


What i need to do is to run an image resize that picks in up from InputStream and writes it out to OutputStream:
Code:
public void setDataContent( InputStream sourceStream )throws IOException{
   Blob image = Hibernate.createBlob( sourceStream ) );   
     ImageUtil.resize(100, "JPG", sourceStream, outputStream);
}


but where do i get the outputstream from? Is there some "write" method i need to overwrite to include my preprocessing of a file before it gets written out?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.