Thanks Brad,
I knew this and this is what I referred to as hiding something under the carpet. I'd use this as the last resort since I'm afraid that my file sizes may start creeping larger and I don't notice that early enough. Perhaps I wasn't clear in my mail. (I'm not sure if I'm clear enough now :) I'd like to ensure that only absolutely necessary things get serialized.
Anyway I'd like to be able to compress the images also when they are in the working memory and zipping of the serialized file doesn't help in that.
Thanks anyway.
Pasi
-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Brad Christiansen
Sent: 12. marraskuuta 2002 9:02
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Out of topic: How to store and serialize
imageseconomically
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".