2013-06-04 81 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