GZipStream effectivness
I am trying to save big UInt16 array into a file. positionCnt is about 50000, stationCnt is about 2500. Saved directly, without GZipStream, the file is about 250MB which can be compressed by external zip program to 19MB. With the following code the file is 507MB. What do I do wrong? GZipStream cmp = new GZipStream(File.Open(cacheFileName, FileMode.Create), CompressionMode.Compress); BinaryWriter fs = new BinaryWriter(cmp); fs.Write((Int32)(positionCnt * stationCnt)); for (int p = 0; p < positionCnt; p++) { for (int s = 0; s < stationCnt; s++) { fs.Write(BoundData[p, s]); } } fs.Close(); Not