Zlib decompress

Jul 15 2008 2:10 AM
I'm connecting with C# to a device over ethernet and sending him messages and reading from it.Everything is working fine for one specific message i'm getting a message compressed with RFC 1950.I have installed  ICSharpCode.SharpZipLib but it is not working.Here is the code:

 //TcpClient
            TcpClient client = new TcpClient();
            IPAddress localAddr = IPAddress.Parse("192.168.1.84");

            int port = 10001;
            client.Connect(localAddr, port);
            //Stream stream = client.GetStream();

            NetworkStream stream = client.GetStream();
byte[] data2 = new byte[30];

   stream.Write(data2, 0, length1);               //this is what am i sendig


//after I write something on the device he is returning me hex values which are commpres
//i have tried with zlib.net.dll
//and with ICSharpCode.SharpZipLib and it doesn't work can anyone help!!!

//this is my code teh read is just waiting and does nothing


 ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream c = new InflaterInputStream(stream);
                        c.Read(data, 0, 150);

P.S i have allready tried with deflate stream and also doesn't work!!!

Answers (2)