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?