ZipEntry与monodroid流

时间:2013-06-04 14:51:46

标签: mono zip xamarin.android xamarin mvvmcross

我想使用Monodroid在Android中解压缩文件。我可以使用属性NextEntry获取我的ZipEntry,但现在我真的需要将此ZipEntry转换为简单的Stream。

编辑:

我的代码的一部分

using System;
using System.IO;
using Java.Util.Zip;
using File = System.IO.File;

  public void ExtractFile(Stream ZipFile, Action<String, Stream> WriteFile)
        {
            ZipInputStream zis;
            try
            {
                zis = new ZipInputStream(ZipFile);
                ZipEntry entry;
                byte[] buffer = new byte[1024];
                int count;

                while ((entry = zis.NextEntry) != null)
                {
                  // HERE I need to call my WriteFile action with a stream
                }
 ...

由于

1 个答案:

答案 0 :(得分:0)

如果您使用的是Ionic.Zip,那么您可以轻松获取: zipentry.InputStream