From 9b28ff411383fc654a5f4def15b996c8f017f7a0 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 20 Dec 2019 17:58:56 +0100 Subject: [PATCH] use decompress for json saving instead --- MLEM.Data/NetExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MLEM.Data/NetExtensions.cs b/MLEM.Data/NetExtensions.cs index c56b59d..436a3c9 100644 --- a/MLEM.Data/NetExtensions.cs +++ b/MLEM.Data/NetExtensions.cs @@ -37,7 +37,7 @@ namespace MLEM.Data { public static void WriteObject(this NetBuffer buffer, T obj, JsonSerializer serializer) { using (var memory = new MemoryStream()) { - using (var gzip = new GZipStream(memory, CompressionLevel.Fastest, true)) + using (var gzip = new DeflateStream(memory, CompressionLevel.Fastest, true)) serializer.Serialize(new BsonDataWriter(gzip), obj, typeof(T)); var arr = memory.ToArray(); buffer.Write(arr.Length); @@ -49,7 +49,7 @@ namespace MLEM.Data { var length = buffer.ReadInt32(); var arr = buffer.ReadBytes(length); using (var memory = new MemoryStream(arr)) { - using (var gzip = new GZipStream(memory, CompressionMode.Decompress, true)) + using (var gzip = new DeflateStream(memory, CompressionMode.Decompress, true)) return serializer.Deserialize(new BsonDataReader(gzip)); } }