Skip to content

Commit

Permalink
fix stream flush
Browse files Browse the repository at this point in the history
  • Loading branch information
turtle-insect committed Nov 25, 2024
1 parent d5a8aaa commit 2f5277a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMNDAT/SaveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public bool Open(String filename)
using (var output = new MemoryStream())
{
zlib.CopyTo(output);
output.Flush();
mBuffer = output.ToArray();
}
}
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions LINKDATA/ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -449,6 +450,7 @@ private Byte[] Decomp(Byte[] data)
using (var output = new MemoryStream())
{
zlib.CopyTo(output);
output.Flush();
result = output.ToArray();
}
}
Expand Down
2 changes: 2 additions & 0 deletions SCSHDAT/SaveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public bool Open(String filename)
using (var output = new MemoryStream())
{
zlib.CopyTo(output);
output.Flush();
mBuffer = output.ToArray();
}
}
Expand Down Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions STGDAT/SaveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ private Byte[] Decomp(Byte[] data)
using (var output = new MemoryStream())
{
zlib.CopyTo(output);
output.Flush();
result = output.ToArray();
}
}
Expand Down

0 comments on commit 2f5277a

Please sign in to comment.