I have code that downloads gzipped files and unpacks them. The problem is that I can not get it to unpack the entire file, it only reads the first 4096 bytes, and then about 500 more.
Byte[] buffer = new Byte[4096]; int count = 0; FileStream fileInput = new FileStream("input.gzip", FileMode.Open, FileAccess.Read, FileShare.Read); FileStream fileOutput = new FileStream("output.dat", FileMode.Create, FileAccess.Write, FileShare.None); GZipStream gzipStream = new GZipStream(fileInput, CompressionMode.Decompress, true);
I checked the downloaded file; it is 13 MB in compression and contains one XML file. I manually unpacked the XML file, and all the content is there. But when I do this with this code, it only outputs the beginning of the XML file.
Does anyone have any idea why this might be happening?
c # gzipstream
Edgar
source share