That did it, Andrej.  Many thanks!
Tom Rochelle

----------
From:   Andrej Gabara
Sent:   Friday, February 11, 2000 11:44 AM
To:     Tom Rochelle
Cc:     [EMAIL PROTECTED]
Subject:        Re: ANY HINTS?


Tom,

close the ObjectOutputStream first, don't just flush it. flush() will flush the
ObjectOutputStream, but it won't have the GZIPOutputStream finish writing its
compressed data.

>           ByteArrayOutputStream baos = new ByteArrayOutputStream();
>           GZIPOutputStream gos       = new GZIPOutputStream( baos );
>           ObjectOutputStream oos     = new ObjectOutputStream( gos );
>           oos.writeObject( names );
>           oos.close();


Andrej

Tom Rochelle wrote:
>
> Hi Everyone:
>
> Any ideas as to why the following code doesn't work?  It generates the following 
>exception:
> I've concluded that the writeObject with the GZIPOutputStream in the mix doesn't 
>generate
> the byte array that should be generated.  Thus, an exception is thrown when the byte 
>array is
> decompressed.  I'm hoping to generate an array of bytes containing the compressed 
>object.
> Using jdk1.2.2.
>
> Per my reading of O'Reilly's Java Examples in a Nutshell pp 266-7 and
> Sun's  http://forum.java.sun.com/forum?[EMAIL PROTECTED]^[email protected]/0
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to