【问题标题】:ZipEntry to Stream with monodroidZipEntry 与 monodroid 一起流式传输
【发布时间】:2013-06-04 14:51:45
【问题描述】:

我想在 Android 中使用 Monodroid 解压缩文件。我可以使用 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
                }
 ...

谢谢

【问题讨论】:

    标签: mono zip xamarin.android xamarin mvvmcross


    【解决方案1】:

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

    【讨论】:

    • 嗨,我没有使用 Ionic.Zip,所以我没有 InputStream 属性
    猜你喜欢
    • 2011-06-17
    • 1970-01-01
    • 2020-07-17
    • 1970-01-01
    • 1970-01-01
    • 2011-05-01
    • 2018-05-27
    • 2011-11-09
    • 2013-09-24
    相关资源
    最近更新 更多