var progress = new StatusNotification("");
- using (var stream = new FileStream(info.FullName,FileMode.Open, FileAccess.Read, FileShare.Read,65536))
+ using (var stream = new FileStream(info.FullName,FileMode.Open, FileAccess.Read, FileShare.Read,Signature.BufferSize))
{
var buffer = new byte[65536];
int counter=0;
- using (var stream = new FileStream(info.FullName,FileMode.Open, FileAccess.Read, FileShare.Read,65536))
+ using (var stream = new FileStream(info.FullName,FileMode.Open, FileAccess.Read, FileShare.Read,Signature.BufferSize))
{
int counter=0;
int bytesRead;
public static class Signature
{
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ public const int BufferSize = 16384;
public const string MD5_EMPTY = "d41d8cd98f00b204e9800998ecf8427e";
string hash;
using (var hasher = MD5.Create())
- using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 65536, true))
+ using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, Signature.BufferSize, true))
{
var hashBytes = hasher.ComputeHash(stream);
hash = hashBytes.ToHashString();
return new TreeHash(algorithm);
//Calculate the hash of all blocks using a blockhash iterator
- using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, blockSize, true))
+ using (var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, BufferSize, true))
{
var md5 = new MD5BlockCalculator();
Action<long, byte[], int> postAction = md5.PostBlock;