GZipThis is a page for GZip file analysis (Header). Try sample file: Try an exampleThe RTF file has a well defined header. |
File contents analysisFile: test.txt.gzStarting tag (should be 0x1F 8B 08): 1F8B08File signature analysis (Header analysis)Additional scanning signature analysisPossible: [Gzip, sig: 1F8B08] Count: 1 File hex characters[00000000] 1F 8B 08 08 B5 7B B6 50 00 0B 74 65 73 74 2E 74 .....{.P..test.t Base-64 conversionH4sICLV7tlAAC3Rlc3QudHh0AAvJyCxWAKJEhZLU4hI9IAAAM/RyZhIAAAA= DecodedThis is a test.... |
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(); }