Replace FileInfo calls

This commit is contained in:
Matt Nadareski
2025-01-05 23:28:50 -05:00
parent 8dee2e2501
commit 142ca6f327

View File

@@ -166,14 +166,11 @@ namespace SabreTools.Hashing
return null;
}
// Set the file size
size = new FileInfo(filename).Length;
// Open the input file
var input = File.OpenRead(filename);
// Return the hashes from the stream
return GetStreamHashes(input, hashTypes);
return GetStreamHashesAndSize(input, hashTypes, out size);
}
/// <summary>
@@ -191,14 +188,11 @@ namespace SabreTools.Hashing
return null;
}
// Set the file size
size = new FileInfo(filename).Length;
// Open the input file
var input = File.OpenRead(filename);
// Return the hashes from the stream
return GetStreamHashArrays(input, hashTypes);
return GetStreamHashArraysAndSize(input, hashTypes, out size);
}
#endregion