2013-06-04 37 views
0

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

编辑:

我的代码一些部分

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 
       } 
... 

感谢

回答

0

如果使用Ionic.Zip,那么你可以很容易地得到它: zipentry.InputStream

+0

喜,我没有使用Ionic.Zip,所以我没有InputStream属性 – Podelo

+0

然后你在用什么? – Roosevelt

+0

我添加了一些代码 – Podelo