End Google Ads 201810 - BS.net 01 --> For some reason, while reading a GZip file I am having an issue where it stops after about 24K characters; it never reaches the end of file (I have tried it on several Gzip files of differing sizes, each containing one text file).

I created a small console app to replicate the problem, see below. Any insight would be welcomed...

Framework is .NET 3.5

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.IO.Compression; namespace GZipDump{ class Program { static void Main(string[] args) { UInt64 charsRead = 0; string file; if (args.Length > 0) file = args[0]; else { Console.Write("GZip file to be read (full path): "); file = Console.ReadLine(); } using (GZipStream gz = new GZipStream(new FileInfo(file).OpenRead(), CompressionMode.Decompress)) { byte[] bytes = new byte[1]; while (gz.Read(bytes, 0, 1) > 0) { Console.Write(Convert.ToChar(bytes[0])); charsRead++; } } Console.WriteLine("\n\nCompleted."); Console.WriteLine("Characters Read: " + charsRead); Console.ReadLine(); } }}