hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amarnath Nalumachu <namar...@adpwilco.com>
Subject Upload gzip file : Unexpected end of ZLIB input stream
Date Fri, 17 Mar 2006 11:53:21 GMT
Hi All,

 

            I am sending a gzip file to a servlet in the following way.

            

            public class GZIPInputStreamRequestEntity extends
InputStreamRequestEntity {

            private byte[] data;

            private long length;

            

            

            public GZIPInputStreamRequestEntity(InputStream in,byte[] data){

                        super(in);

                        this.data = data;

            }

            public GZIPInputStreamRequestEntity(InputStream content, long
contentLength, String contentType,byte[] data) {

                        super(content,contentLength,contentType);

                        this.length = contentLength;

                        this.data = data;

            }

            public void writeRequest(OutputStream out) throws IOException {

                        GZIPOutputStream gos = new GZIPOutputStream(new
BufferedOutputStream(out));

                        gos.write(data, 0, data.length);

                        

                        //gos.finish();

                        gos.flush();

                        //gos.close();

            }

            

}

 

            Since the gzip stream is not closed; while reading the stream at
the server end following error is

thrown:

 

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

            

            I have tried to send using multi part but the same error.
Solution this problem seems to be closing

the output stream. If the output stream is closed, socket and connection
closed exceptions are thrown.

 

                        

            Appreciate any help in this regard.

 

 

Thanx & Regards

amar



This message is confidential and may also be legally privileged. If you are not the intended
recipient, please notify postmaster@adpwilco.com immediately. You should not copy it or use
it for any purpose, nor disclose its contents to any other person. The views and opinions
expressed in this e-mail message are the author's own and may not reflect the views and opinions
of ADP.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message