我正在尝试按此按钮,但是它不起作用。我离开了代码。
using
var memStr = new MemoryStream();
////Write
var data = new byte[] { 0, 11, 22, 3, 4, 5, 6, 7, 8, 9 };
using (GZipStream compressionStream = new GZipStream(memStr, CompressionMode.Compress))
{
compressionStream.Write(data, 0, data.Length);
}
////Read
var array1 = new byte[10];
using (MemoryStream mem = new MemoryStream(memStr.ToArray()))
using (GZipStream decompressionStream = new GZipStream(mem, CompressionMode.Decompress))
{
decompressionStream.Read(array1, 0, array1.Length);
}