/// <summary> /// 保存断点信息到文件 /// </summary> /// <param name="resumeInfo">断点信息</param> /// <param name="recordFile">断点记录文件</param> public static void Save(ResumeInfo resumeInfo, string recordFile) { var jsonStr = resumeInfo.ToJsonStr(); using (var fs = new FileStream(recordFile, FileMode.Create)) { using (var sw = new StreamWriter(fs)) { sw.Write(jsonStr); } } }
public ResumeBlocker( ManualResetEvent doneEvent, byte[] blockBuffer, long blockIndex, string uploadToken, PutExtra putExtra, ResumeInfo resumeInfo, Dictionary <long, HttpResult> blockMakeResults, object progressLock, Dictionary <string, long> uploadedBytesDict, long fileSize) { DoneEvent = doneEvent; BlockBuffer = blockBuffer; BlockIndex = blockIndex; UploadToken = uploadToken; PutExtra = putExtra; ResumeInfo = resumeInfo; BlockMakeResults = blockMakeResults; ProgressLock = progressLock; UploadedBytesDict = uploadedBytesDict; FileSize = fileSize; }