Skip to content

Commit 7f0079b

Browse files
authored
Merge pull request #4 from bertrandbrasseur/master
fix issue with .NET6 (failing decompress large gzip text)
2 parents 6410574 + 6e55d8b commit 7f0079b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

NETCoreSync/SyncEngineHelpers.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ internal static string Decompress(byte[] data)
4747
{
4848
using (var gzip = new GZipStream(ms, CompressionMode.Decompress))
4949
{
50-
gzip.Read(buffer, 0, uncompressedSize);
50+
int totalRead = 0;
51+
while (totalRead < buffer.Length)
52+
{
53+
int bytesRead = gzip.Read(buffer, totalRead, buffer.Length - totalRead);
54+
if (bytesRead == 0) break;
55+
totalRead += bytesRead;
56+
}
5157
}
5258
}
5359
return Encoding.Unicode.GetString(buffer);

0 commit comments

Comments
 (0)