Re: Chunked GZIP processing using Java Sockets
- From: aztechnology@xxxxxxxxx
- Date: 24 Mar 2006 18:22:21 -0800
Sockets give me the control on handling network problems and server
responses the way I like it to. I need the total control - so for my
needs I know I cannot use JRE HTTPConnectionURL APIs.
So I guess I need to do this:
InputSptream is = new
unGZipstream(de-chunkstream(socket.getinputstream());
And then I need to find the chunkingstream code.
Also, how do I strip the headers before calling the above line? Just
advance the stream until the input stream is past the headers? I can
do readLine() perhaps 13/14 times to get the stream to point to the
dechnked/gzip data in the stream.
Thanks
tom fredriksen wrote:
aztechnology@xxxxxxxxx wrote:
Hi,
My java client program is reading web sites using low level sockets.
The response from the web site HTML is chunked and gzipped. I am aware
of the HTTPClient and JRE's HTTPUrlConnection APIs that can handle this
directly, however; I must use the low level socket due to the error
control that I need to implement is not available via HTTPClient/JRE.
Can anyone be kind enough to point me how to read http response that is
chunked and gzipped using java sockets? Are thre any classes that
provide the ability to coalesce the chunked stream and then deflate the
zipped contents?
Could you give a little more information as to why you need to use the
socket? It seems to me as bad design doing it that way, maybe I am wrong
though. Could you not have it as to separate tasks? Where the socket
operation handles any errors while the API handles all non error
situations, that way you would have automatic dechunking and gzipping,
while at the same time error control.
I am sorry if this sounds like a bad idea, but I dont have any info on
architecture so its difficult to say if there is a better way of doing
it. It just sound to me like what you have now is not good architecture:(
/tom
.
- Follow-Ups:
- Re: Chunked GZIP processing using Java Sockets
- From: tom fredriksen
- Re: Chunked GZIP processing using Java Sockets
- References:
- Chunked GZIP processing using Java Sockets
- From: aztechnology
- Re: Chunked GZIP processing using Java Sockets
- From: tom fredriksen
- Chunked GZIP processing using Java Sockets
- Prev by Date: Re: J2EE Interview questions and answers
- Next by Date: Re: Are you a Rockstar in Java Programming ?
- Previous by thread: Re: Chunked GZIP processing using Java Sockets
- Next by thread: Re: Chunked GZIP processing using Java Sockets
- Index(es):
Relevant Pages
|