[英]write zip file content from memory to a console app
很抱歉,但我不知道从哪里开始我需要一种方法来实时使用 zip 文件中的文件,因为它们被解压缩就像从文件 stream 中写入控制台应用程序是三星 odin flash 程序和 arguments 像odin --flash --recovery /recovery.img path --boot /boot.img path etc
和解压三星固件文件需要太多的duo到其中一些文件的大尺寸所以我正在寻找一种方法来制作参数go像odin --flash --recovery 'stream providing the recovery.img file as it unzip'
我不知道这是否可能,但我希望有办法做到这一点
我没有尝试任何事情,因为我不知道从哪里开始
这是不可能的,因为odin
需要一个文件名,而不是 stream 的数据。 如果你想从 a.zip 打印一个解压文件到控制台,你会做这样的事情:
using System.IO.Compression;
using System.Text;
static void PrintZipFile(string zipPath, int fileIndex)
{
using var zip = ZipFile.OpenRead(zipPath);
using Stream firstEntry = zip.Entries[fileIndex].Open();
using var r = new BinaryReader(firstEntry);
Console.WriteLine(Encoding.ASCII.GetString(r.ReadBytes((int)r.BaseStream.Length)));
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.