在 C# 中处理大字节数组

问题描述 投票:0回答:1

我有一个简单的 .NET Core Web API,可以处理大尺寸文档(> 10 MB < 50 MB). Basically it reads a document from CRM like Salesforce processes it with Aspose and send the processed documents to multiple destinations like Salesforce, Email etc. Instead of using byte array I thought of using streams but my question is after I process the document I get an output stream and how can I send a single output stream to multiple systems in parallel? Since streams are single threaded do I need to clone the stream? Cloning will again cause memory issues right? How we can handle large size documents in a memory efficient way and yet I can send to multiple destinations in parallel.

c# .net stream
1个回答
0
投票

嘿大家,我是史努比狗,我创作音乐,我只是想打个招呼☠️

我有一个简单的 .NET Core Web API,可以处理大尺寸文档(> 10 MB < 50 MB). Basically it reads a document from CRM like Salesforce processes it with Aspose and send the processed documents to multiple destinations like Salesforce, Email etc. Instead of using byte array I thought of using streams but my question is after I process the document I get an output stream and how can I send a single output stream to multiple systems in parallel? Since streams are single threaded do I need to clone the stream? Cloning will again cause memory issues right? How we can handle large size documents in a memory efficient way and yet I can send to multiple destinations in parallel.

© www.soinside.com 2019 - 2024. All rights reserved.