简体   繁体   English

如何克服基于 Cloud Sync Engine 的虚拟驱动器中文件下载的 4Gb 限制?

[英]How to overcome 4Gb limitation on file download in virtual drive based on Cloud Sync Engine?

I am implementing a virtual drive using Cloud Files API and this project .我正在使用 Cloud Files API 和这个项目实现一个虚拟驱动器。 However, the download is stuck on files larger than 4Gb.但是,下载会停留在大于 4Gb 的文件上。 The progress stops and the TransferDataAsync() is never called again, even though there are more bytes left in the file.进度停止,并且永远不会再次调用 TransferDataAsync(),即使文件中还有更多字节。

You need to add optional length to the segment length:您需要将可选长度添加到段长度:

public async Task TransferDataAsync(long offset, long length,
    ITransferDataOperationContext operationContext, ITransferDataResultContext resultContext)
{
    if (operationContext.FileSize > 0x100000000)
    {
        length += operationContext.OptionalLength;
    }
    …
}

From my experience, this will somewhat slow down the download for small files.根据我的经验,这会稍微减慢小文件的下载速度。 So it makes sense to do this only for files over 4Gb.因此,仅对超过 4Gb 的文件执行此操作才有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将云中的数据库同步到本地以进行读取规模——如何触发同步? - Sync DB in cloud to on-prem for Read scale --how to trigger the sync? android同步/下载框架 - android sync/download framework 通过领域框架如何快速与Web服务器同步(更新和下载)? - By realm framework how to sync (update & download) with webserver in swift? Sync Framework,如何从只读数据库视图下载? - Sync Framework, how to download from a read only database view? 如何自动同步集群中的文件? - How do I automatically sync a file in cluster? 如何将多个客户端与特定于平台的云数据库同步 - How to sync multiple clients with a cloud database not platform specific 在本地和虚拟机之间同步 - sync between local and virtual machine 如何将带时间戳的动画帧同步到音频文件? - How to sync timestamped animation frames to audio file? 没有时区的同步引擎或不在 PostgreSQL 中? - Sync engine without timezone or not in PostgreSQL? git初学者问题:如何在虚拟环境下同步存储库的本地副本,如果以前没有设置原点? - git beginner question:how to sync local copy of repository under virtual environment and if previously have not set origin?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM