diff --git a/src/ADB/Java/JavaTask.cs b/src/ADB/Java/JavaTask.cs index 4e8ec5e..de0005e 100644 --- a/src/ADB/Java/JavaTask.cs +++ b/src/ADB/Java/JavaTask.cs @@ -269,11 +269,10 @@ public static void ExtractTarGz(Stream stream, string outputDir) using var memStr = new MemoryStream(); int read; var buffer = new byte[chunk]; - do + while ((read = gzip.Read(buffer, 0, buffer.Length)) > 0) { - read = gzip.Read(buffer, 0, chunk); memStr.Write(buffer, 0, read); - } while (read == chunk); + } memStr.Seek(0, SeekOrigin.Begin); ExtractTar(memStr, outputDir);