[
  {
    "Id": "1320081",
    "ThreadId": "571542",
    "Html": "<pre><code>public static void ExtractFile()\n            {\n\n                int i = 0;\n                const string zipPath = @&quot;C:\\Product Development\\Development\\FFPCAppTool\\PCToolForFF\\PCToolForFF\\bin\\x86\\Debug\\000A1C10000101.fdd&quot;;\n\n                if (zipPath.Contains(&quot;000A1C10000101.fdd&quot;))\n                {\n                    byte[] arrayWholeFileInBytes = File.ReadAllBytes(zipPath);\n                   \n                    long fileLength = new FileInfo(zipPath).Length;\n                \n                 while (i &lt; fileLength)\n                    {\n                        using (BinaryReader reader = new BinaryReader(new FileStream(zipPath, FileMode.Open)))\n                        {\n                            reader.BaseStream.Seek(i, SeekOrigin.Begin);\n                            reader.Read(arrayWholeFileInBytes, i, 4); //reading value in bytes \n\n                            n = BitConverter.ToInt32(arrayWholeFileInBytes, i);\n                                //converting first four bytes into a single integer value i.e. size of zip\n                            reader.Read(arrayWholeFileInBytes, i + 4, n);\n                            \n                            byte[] array1 = new byte[n]; //passing the size of zip into array size\n                            Array.Copy(arrayWholeFileInBytes, i + 4, array1, 0, n);\n                             byte[] newarray1 = Ionic.Zlib.ZlibStream.UncompressBuffer(array1);\n\n                            i = i + n + 4;\n                        }\n                    }\n\n                }\n            }\n</code></pre>\n\nI 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..... \r<br />\n<br />\n231 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.\r<br />\n<br />\n&quot;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. \r<br />\n<br />\nI am getting this error &quot;Bad state (incorrect data check)&quot; if I use DotNetZipLib v 1.9.1.8<br />\n",
    "PostedDate": "2014-11-07T09:31:58.58-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]