我正在使用ICSharpCode.SharpZipLib.Core库来压缩我的 C# 代码中的文件。压缩后我将返回一个字节数组。有什么方法可以找到字节数组中的文件数?
我的代码看起来像
string FilePath ="C:\HELLO";
 MemoryStream outputMemStream = new MemoryStream();
            ZipOutputStream zipStream = new ZipOutputStream(outputMemStream);
            foreach (var file in files)
            {
                FileInfo fi = new FileInfo(string.Concat(FilePath, file));
                if (fi.Exists)
                {
                    var entryName = ZipEntry.CleanName(fi.Name);
                    ZipEntry newEntry = new ZipEntry(entryName);
                    newEntry.DateTime = DateTime.Now;
                    newEntry.Size = fi.Length;
                    zipStream.PutNextEntry(newEntry);
                    byte[] buffer = new byte[4096];
                    var fs = File.OpenRead(string.Concat(FilePath, file));
                    var count = fs.Read(buffer, 0, buffer.Length);
                    while (count > 0)
                    {
                        zipStream.Write(buffer, 0, count);
                        count = fs.Read(buffer, 0, buffer.Length);  
                    }
                }
            }
            zipStream.Close();
            byte[] byteArrayOut = outputMemStream.ToArray();
            return byteArrayOut;