Unstable 0.1500.0.0

This commit is contained in:
Markus Isberg
2021-08-26 21:08:21 +09:00
parent 265a2e7ab3
commit 501e02c026
245 changed files with 9775 additions and 2034 deletions
@@ -296,20 +296,10 @@ namespace Barotrauma
public static void CompressStringToFile(string fileName, string value)
{
// A.
// Write string to temporary file.
string temp = Path.GetTempFileName();
File.WriteAllText(temp, value);
// Convert the string to its byte representation.
byte[] b = Encoding.UTF8.GetBytes(value);
// B.
// Read file into byte array buffer.
byte[] b;
using (FileStream f = File.Open(temp, System.IO.FileMode.Open))
{
b = new byte[f.Length];
f.Read(b, 0, (int)f.Length);
}
// C.
// Use GZipStream to write compressed bytes to target file.
using (FileStream f2 = File.Open(fileName, System.IO.FileMode.Create))
using (GZipStream gz = new GZipStream(f2, CompressionMode.Compress, false))