On the English version of the site I found a method that suits me very much:
public static byte[] Decompress(byte[] gzip) { using (var stream = new Ionic.Zlib.ZlibStream(new MemoryStream(gzip), Ionic.Zlib.CompressionMode.Decompress)) { const int size = 1024; byte[] buffer = new byte[size]; using (MemoryStream memory = new MemoryStream()) { int count = 0; do { count = stream.Read(buffer, 0, size); if (count > 0) { memory.Write(buffer, 0, count); } } while (count > 0); return memory.ToArray(); } } } To call the method I use
private void converttotarTool_Click(object sender, EventArgs e) { byte[] app = Decompress(File.ReadAllBytes(@"D:\ab\2017-01-03_141454.ab")); File.WriteAllBytes(@"D:\ab\backup.tar", app); } If you convert to ".tar" backups of small size, then there are no problems. In my case, backup 1.6 GB - an outofmemory error occurs. Tell me how to fix the method so that all content is thrown into the RAM by parts?