GZip File Contents Analysis[Back] This is a page for GZip file analysis (Header). Try sample file: Try an exampleTry your ownOr enter your own URL to analyse the first six sectors of the file: The RTF file has a well defined header. |
File contents analysisObject reference not set to an instance of an object. |
Sample code
public string readfileZIP(string fname) { byte[] buffer = new byte[999999]; string s = "", responseFromServer = ""; int n; FileStream sourceFile = System.IO.File.OpenRead(fname); GZipStream input = new GZipStream(sourceFile, CompressionMode.Decompress, false); do { n = input.Read(buffer, 0, buffer.Length); if (n != 0) { System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); string str = enc.GetString(buffer); responseFromServer += str; } } while (n > 0); return (responseFromServer); sourceFile.Close(); input.Close(); }