diff --git a/CMNDAT/SaveData.cs b/CMNDAT/SaveData.cs index 58fe5b7..275088f 100644 --- a/CMNDAT/SaveData.cs +++ b/CMNDAT/SaveData.cs @@ -41,6 +41,7 @@ public bool Open(String filename) using (var output = new MemoryStream()) { zlib.CopyTo(output); + output.Flush(); mBuffer = output.ToArray(); } } @@ -69,6 +70,7 @@ public bool Save() using (var zlib = new System.IO.Compression.ZLibStream(output, System.IO.Compression.CompressionLevel.Fastest)) { input.CopyTo(zlib); + zlib.Flush(); } comp = output.ToArray(); } diff --git a/LINKDATA/ViewModel.cs b/LINKDATA/ViewModel.cs index 44e41da..af0b6e7 100644 --- a/LINKDATA/ViewModel.cs +++ b/LINKDATA/ViewModel.cs @@ -432,6 +432,7 @@ private Byte[] Comp(Byte[] data) using (var zlib = new System.IO.Compression.ZLibStream(output, System.IO.Compression.CompressionLevel.Fastest)) { input.CopyTo(zlib); + zlib.Flush(); } result = output.ToArray(); } @@ -449,6 +450,7 @@ private Byte[] Decomp(Byte[] data) using (var output = new MemoryStream()) { zlib.CopyTo(output); + output.Flush(); result = output.ToArray(); } } diff --git a/SCSHDAT/SaveData.cs b/SCSHDAT/SaveData.cs index 11add51..7495629 100644 --- a/SCSHDAT/SaveData.cs +++ b/SCSHDAT/SaveData.cs @@ -42,6 +42,7 @@ public bool Open(String filename) using (var output = new MemoryStream()) { zlib.CopyTo(output); + output.Flush(); mBuffer = output.ToArray(); } } @@ -70,6 +71,7 @@ public bool Save() using (var zlib = new System.IO.Compression.ZLibStream(output, System.IO.Compression.CompressionLevel.Fastest)) { input.CopyTo(zlib); + zlib.Flush(); } comp = output.ToArray(); } diff --git a/STGDAT/SaveData.cs b/STGDAT/SaveData.cs index cd3a7ca..ec1717b 100644 --- a/STGDAT/SaveData.cs +++ b/STGDAT/SaveData.cs @@ -407,6 +407,7 @@ private Byte[] Decomp(Byte[] data) using (var output = new MemoryStream()) { zlib.CopyTo(output); + output.Flush(); result = output.ToArray(); } }