Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java.io.EOFException: Unexpected end of ZLIB input stream????????

700 views
Skip to first unread message

Carlos Nicholas Fernandes

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
Hi,

I'm transferring a ObjectOutputStream which I wrap in GZIPOutputstream.
Correspondingly, I use GzipInputStream to recieve it; However I get the
above error ... if I just use Objectoutputstream without wrapping it
works fine. What could be the problem. So far I believed that if any
stream could be sent across; it could be zipped and sent across without
any problem. My problem occurs while trying to read from the stream:

java.io.EOFException: Unexpected end of ZLIB input stream

Please help.
TIA,
Carlos

pls cc to my mail as well.

--
"...the people who are crazy enough to think they
can change the world...are the ones who do."
- 'Think Different' - Apple Computer, 1997

Trung Tran-Duc

unread,
Nov 30, 1998, 3:00:00 AM11/30/98
to Carlos Nicholas Fernandes
Carlos Nicholas Fernandes <car...@mailhost.krdl.org.sg> wrote:

> Hi,
>
> I'm transferring a ObjectOutputStream which I wrap in GZIPOutputstream.
> Correspondingly, I use GzipInputStream to recieve it; However I get the
> above error ... if I just use Objectoutputstream without wrapping it
> works fine. What could be the problem. So far I believed that if any
> stream could be sent across; it could be zipped and sent across without
> any problem. My problem occurs while trying to read from the stream:
>
> java.io.EOFException: Unexpected end of ZLIB input stream

I remember that if you're reading from ZipInputStream you cannot rely
on read() returning -1 on EOF. Instead first use available() to
determine the data size and read exactly up to that number of bytes

(Of course I'm not sure if it's your problem)

-trung

>
> Please help.
> TIA,
> Carlos
>
> pls cc to my mail as well.
>
> --
> "...the people who are crazy enough to think they
> can change the world...are the ones who do."
> - 'Think Different' - Apple Computer, 1997

--
To reply by e-mail, remove 'KILLSPAM' from my address in From: line

Carlos Nicholas Fernandes

unread,
Nov 30, 1998, 3:00:00 AM11/30/98
to
Ok, let me be more clear. Im transferring objects from a servlet to an
applet. The applet can write an Objectoutputstream to the servlet ...
however the reverse doesnt work. When I transfer my object across (a
quadtree) I get;

java.io.EOFException: Unexpected end of ZLIB input stream

When I just try to send an integer across (for testing) I get

Streamcorrupted exception and something being mentioned about he stream
header causing problems. Is it that the http headers which are sent along
are somehow interferring?

I have something like this ...

ObjectOutputStream oos =new ObjectOutputStream((new
GZIPOutputStream(servletoutputstreamobjectref)))

And i recieve it with the corresponding input streams ... is there anything
im doing wrong??!

TIA,
Carlos

Carlos Nicholas Fernandes wrote:

> Hi,
>
> I'm transferring a ObjectOutputStream which I wrap in GZIPOutputstream.
> Correspondingly, I use GzipInputStream to recieve it; However I get the
> above error ... if I just use Objectoutputstream without wrapping it
> works fine. What could be the problem. So far I believed that if any
> stream could be sent across; it could be zipped and sent across without
> any problem. My problem occurs while trying to read from the stream:
>
> java.io.EOFException: Unexpected end of ZLIB input stream
>

Joshua Turner

unread,
Dec 31, 1998, 3:00:00 AM12/31/98
to
Hmm... I use this technique myself with great success -- are you ensuring
that your servlet knows that you are sending an unusual content-type? If
you're using HTTP, does your applet know?


0 new messages