[
  {
    "Id": "656957",
    "ThreadId": "268796",
    "Html": "\r\n<p>Please excuse me if there is an obvious answer to this problem, but I've checked the documentation and discussion page here on CodePlex.</p>\r\n<p>I have a headerless file containing only the result of a GZip compression.&nbsp; It was produced by a very popular third party program to store data for its own use, and because it was not intended for use by any other application, the file itself is not\r\n a proper GZip archive - it has neither the .gz extension nor a header of any kind, only the binary data.&nbsp; My application is designed to be one of many third party editors, and thus I must read and write data in the format expected by this application.&nbsp;\r\n If I decompress the file using 7-Zip, I get exactly what I expect when looking at the result in a hex editor, based on the author's specification for the format of the data (that is, the format of the binary data that has been compressed).&nbsp; The popularity\r\n of this application makes it easy to confirm that the binary data is GZipped, just as the author states.</p>\r\n<p>I would use System.IO.GZipStream, as I only need to decompress binary data, but I have heard in numerous places that it is flawed and can only read or write to streams of a certain length.&nbsp; I was hoping to use DotNetZip's Ionic.Zlib.<span id=\"chickenFeet\"><span>GZipStream,\r\n but I get an exception of type </span></span>Ionic.Zlib.ZlibException (&quot;Bad GZIP header.&quot;), because of course this is not a GZip archive, only GZipped binary data.</p>\r\n<p>Is there a way to compress and decompress a GZip stream without performing the file header validation?&nbsp; I noticed from the stack trace that the validation is performed by a class called Ionic.Zlib.ZlibBaseStream, which sounds like what I might need,\r\n but I make it a practice not to dig around in code not part of an assembly's public interface :)</p>\r\n<p>Any suggestions?</p>\r\n",
    "PostedDate": "2011-08-11T22:29:21.373-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "657886",
    "ThreadId": "268796",
    "Html": "<p>Try ZlibStream or DeflateStream.&nbsp;</p>\r\n<p>They work like GZipStream but use different decorating metadata.</p>\r\n<p>From your description , I don't know what sort of compressed file you have, but one of those streams might read it.</p>",
    "PostedDate": "2011-08-13T17:52:16.13-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "657902",
    "ThreadId": "268796",
    "Html": "<p>Hold on... I think I must have made the mistake of thinking GZip is a compression algorithm, but it's an archive format, isn't it?</p>",
    "PostedDate": "2011-08-13T19:23:49.86-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "657973",
    "ThreadId": "268796",
    "Html": "<p>GZip is a data format as described in <a href=\"http://www.ietf.org/rfc/rfc1952.txt\">RFC 1952</a>.&nbsp; Think of it as a compressed stream of bytes, surrounded by a header and trailer which describe those bytes, and provide a CRC for the uncompressed stream, respectively.</p>\r\n<p>For compression, GZIP uses DEFLATE primarily, but other compression algorithms can theoretically be employed.&nbsp;</p>\r\n<p>If you have a raw compressed stream, you might want to try the DeflateStream.&nbsp;</p>",
    "PostedDate": "2011-08-14T06:42:00.32-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "658529",
    "ThreadId": "268796",
    "Html": "<p>It appears that my problems with the GZip header are entirely due to my own stupidity.&nbsp; I was completely new to working with streams, and I was using a BinaryReader and thought it copied the stream and then read it.&nbsp; I didn't even think of changing the position of the underlying stream before wrapping it in a GZipStream.</p>\r\n<p>When I tried DeflateStream and it worked, I tried GZipStream again, and realized that I had already fixed my mistake because I have learned quite a bit about streams in the last couple days while working with decompressed data files.</p>\r\n<p>Thanks for your responses, and keep up the good work!&nbsp; GZipStream is great!</p>",
    "PostedDate": "2011-08-15T13:49:46.187-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]