"Bad state (incorrect data check)"

Nov 7, 2014 at 4:31 PM
public static void ExtractFile()
            {

                int i = 0;
                const string zipPath = @"C:\Product Development\Development\FFPCAppTool\PCToolForFF\PCToolForFF\bin\x86\Debug\000A1C10000101.fdd";

                if (zipPath.Contains("000A1C10000101.fdd"))
                {
                    byte[] arrayWholeFileInBytes = File.ReadAllBytes(zipPath);
                   
                    long fileLength = new FileInfo(zipPath).Length;
                
                 while (i < fileLength)
                    {
                        using (BinaryReader reader = new BinaryReader(new FileStream(zipPath, FileMode.Open)))
                        {
                            reader.BaseStream.Seek(i, SeekOrigin.Begin);
                            reader.Read(arrayWholeFileInBytes, i, 4); //reading value in bytes 

                            n = BitConverter.ToInt32(arrayWholeFileInBytes, i);
                                //converting first four bytes into a single integer value i.e. size of zip
                            reader.Read(arrayWholeFileInBytes, i + 4, n);
                            
                            byte[] array1 = new byte[n]; //passing the size of zip into array size
                            Array.Copy(arrayWholeFileInBytes, i + 4, array1, 0, n);
                             byte[] newarray1 = Ionic.Zlib.ZlibStream.UncompressBuffer(array1);

                            i = i + n + 4;
                        }
                    }

                }
            }
I have a large file with .fdd extension which contains 3 zlib compressed files ( .ffo, .sym and .cff) . According to the document that I have, the first 4 bytes contain the size of the .ffo file. So inside the while loop, I am first reading the first 4 bytes, converting the 4 bytes into an integer value to get the size of the ffo and then reading the arraywholefileinbytes from 5th byte to the size obtained(27623) from first four bytes, then I read from byte[27627] to byte[27631] which gives me the size(2216) of sym file(after converting 4 bytes into integer value) and so on.....

231 107 0 0 120 156 236 189 7 124 28 201 117 38 222 53 51 192 0 32 114 6 8 34 49 129 57 103 46 211......these are the values that I can see when I debug the code, from arraywholefilebytes[0] to arraywholefilebytes[29]. These are not in hex format I guess. I can see these simple decimal values in byte array.

"E7-6B-00-00-78-9C-EC-BD-07-7C-1C-C9-75-26-DE-35-33-C0-00-20-72-06-08-22-31-81-3‌​9-67-2E-D3-this what I get if I convert the first 30 bytes to hex using bitconverter.

I am getting this error "Bad state (incorrect data check)" if I use DotNetZipLib v 1.9.1.8