适用于Azure存储的ReadWrite流 [英] ReadWrite Stream for Azure Storage

查看:95
本文介绍了适用于Azure存储的ReadWrite流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure存储或Azure文件是否提供blob的ReadWrite流,而无需将blob下载到本地计算机内存或磁盘上.在Streams上有一些操作要求Stream的CanRead()和CanWrite()为true,例如下面的示例在Zip文件上 存储为Azure blob,我想更新一个zip文件中的文件.这里Package.Open()需要一个ReadWrite流

Does Azure Storage or Azure File provides ReadWrite Stream of a blob, without downloading the blob on a local machine memory or disk. There are some operation on Streams requires Stream with CanRead() and CanWrite() as true e.g. below example on Zip file stored as Azure blob and I would like to update a file inside a zip file.  Here Package.Open() expects an ReadWrite Stream

  使用Microsoft.WindowsAzure.Storage;
   使用Microsoft.WindowsAzure.Storage.Blob;
   使用System.IO.Packaging;
   使用Microsoft.WindowsAzure.Storage.File;
   使用System.IO.Compression;

    using Microsoft.WindowsAzure.Storage;
    using Microsoft.WindowsAzure.Storage.Blob;
    using System.IO.Packaging;
    using Microsoft.WindowsAzure.Storage.File;
    using System.IO.Compression;

使用(打包程序包= Package.Open(zipFileStream,FileMode.Open,FileAccess.ReadWrite))
           {
                             PackagePart part = package.GetPart(新Uri(relativeFilePath,UriKind.Relative));
                            使用(StreamWriter writer = new StreamWriter(part.GetStream()))
                             {
                    writer.Write(updateContent);
                    writer.Flush();
                             }
           }

using (Package package = Package.Open(zipFileStream, FileMode.Open, FileAccess.ReadWrite))
            {
                PackagePart part = package.GetPart(new Uri(relativeFilePath, UriKind.Relative));
                using (StreamWriter writer = new StreamWriter(part.GetStream()))
                {
                    writer.Write(updateContent);
                    writer.Flush();
                }
            }

推荐答案

我要求您在以下位置提交想法 反馈 .

I would request you to submit an idea at Feedback.

您分享的所有反馈在这些论坛中,将由负责构建Azure的Microsoft工程团队进行监视和审查.


这篇关于适用于Azure存储的ReadWrite流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆