我有由较小文件组成的大文件(通常为 300 MB 到 2 GB)。我想将它们解压缩到文件夹中,并且我想有效地做到这一点(零拷贝)。
我发现,.NET Framework 有TransmitFile方法
using (StreamWriter writer = File.CreateText(outputPath))
{
HttpResponse response = new HttpResponse(writer);
response.TransmitFile(inputPath, offset, length);
}
但是我的目标是 .NET Core 呢?
IHttpSendFileFeature 接口看起来很有希望,它可能在OwinFeatureCollection 类中实现,但我该如何使用它呢?