return _bufferMgr;\r
}\r
\r
- public static async Task<ConcurrentDictionary<long, byte[]>> CalculateBlockHashesInPlacePFor(FileStream stream, int blockSize, string algorithm, int parallelism)\r
+ public static async Task<ConcurrentDictionary<long, byte[]>> CalculateBlockHashesInPlacePFor(FileStream stream, int blockSize, string algorithm, int parallelism,IProgress<double> progress )\r
{\r
if (stream == null)\r
throw new ArgumentNullException("stream");\r
long index = 0;\r
\r
\r
- while ((read = await stream.ReadAsync(buffer[bufIdx], 0, blockSize)) > 0)\r
+ while ((read = await stream.ReadAsync(buffer[bufIdx], 0, blockSize).ConfigureAwait(false)) > 0)\r
{\r
index += read;\r
indices[bufIdx] = index;\r
(double)filePosition / size);\r
*/\r
hashes[filePosition] = hash;\r
+ progress.Report((long)hashes.Count*blockSize*1.0/stream.Length);\r
});\r
}\r
bufIdx = (bufIdx + 1)%parallelism;\r