Hi, I am not sure how this fits in with what you want, but you can compress the results of object serilization. Just wrap your ObjectOutputStream in a zip or gzip output stream.
eg ByteArrayOutputStream baos = new ByteArrayOutputStream(); GZIPOutputStream gzos = new GZIPOutputStream(baos); ObjectOutputStream oos = new ObjectOutputStream(gzos); now objects written to 'oos' will be gzipped and stored in the byte array of the 'baos'. Cheers, Brad > Pasi Paasiala wrote: > > Hello all, > > Even though this is not strictly a Java3D question I think there might be people who >know or are interested in this question. > Sorry for the rest. > > In our application we are taking snapshots from Canvas3D and we maintain them as >BufferedImages in the memory. I have found > out that each image takes quite a lot of memory and when we save the images during >serialization as pixels, the file size is > enourmous. I'm also sure that these pixels contain lots of redundancy and they could >easily be compressed. So I have two > questions: > > What is an economic format to store an image in the memory while it's not being >displayed? > > How can I compress the image when it is being serialized? > > Somebody might say that I could compress my whole serialized file, but I'd rather >not start from that, since it might hide > other problems under the carpet. > > Thanks, > > Pasi ---------------------------------------------------------------------------- This Email may contain confidential and/or privileged information and is intended solely for the addressee(s) named. If you have received this information in error, or are advised that you have been posted this Email by accident, please notify the sender by return Email, do not redistribute it, delete the Email and keep no copies. ---------------------------------------------------------------------------- =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
