コード例 #1
0
        /// <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);
                }
            }
        }
コード例 #2
0
 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;
 }