http/1.1 decompress

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

I'm writing an application who 'sniffs' port 80.
The sniffing works 'perfect', I receive a byte array with the data sent over
the port.
My problem is the following, when I write the array to a txt file most of
the content is encoded.
The only things that are readable are the http headers from which I can read
that Internet Explorer uses "content-encoding: gzip, deflate".

So I may conclude that I'll need to decompress the data I received.
This is easier said than done:).
I tried to decompress with GZipStream, DeflateStream (both from .NET 2.0)
and SharpZipLib.Gzip.GzipInputstream but neither of them want to decompress
my array.
In the beginning I received several errors about an incorrect magicnumber
and incorrect format. I thought why not add the gzip header
(31,139,8,0,0,0,0,0,0,0) at the start of my array.
..Net didn't throw any exceptions but it didn't decompress (the output is now
an empty file because the bytesread of my decompress stream is 0) my data
either.

Does anyone knows how that Internet Explorer performs the decompression or
how I can perform the decompression myself?

Thx in advance

Frederik.


.



Relevant Pages

  • Re: http/1.1 decompress
    ... I receive a byte array with the data sent ... The only things that are readable are the http headers from which I can ... So I may conclude that I'll need to decompress the data I received. ... In the beginning I received several errors about an incorrect magicnumber ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: LZW Compression algorithm
    ... based on the 128 ascii character set and I can find a lot of information on ... file so that it can be used the next time you need to decompress a file. ... array since if you compressed the file and then shut down the program, ... note that if you are looking for a simple compressor that does fairly well, ...
    (comp.compression)
  • Re: LZW .Z Decompression?
    ... I can't imagine that this topic is new and maybe I'm looking in the ... My desire would be to read in the compressed file into a byte array. ... Pass that array to the decompress function, and be returned a new byte ... Guidance/direction would be greatly appreciated. ...
    (microsoft.public.vb.general.discussion)
  • LZW .Z Decompression?
    ... can't imagine that this topic is new and maybe I'm looking in the wrong ... I have a series of .Z files that I need to decompress ... My desire would be to read in the compressed file into a byte array. ...
    (microsoft.public.vb.general.discussion)
  • Re: http/1.1 decompress
    ... I should be able to remove the content-encoding field from the header before ... I'm writing an application who 'sniffs' port 80. ... I receive a byte array with the data sent ... So I may conclude that I'll need to decompress the data I received. ...
    (microsoft.public.dotnet.languages.csharp)