Skip to content

Instantly share code, notes, and snippets.

public static class FileComparer
{
public static bool CompareEquals(string filePath1, string filePath2, int bufferSize = 65536)
{
if (filePath1 == filePath2) return true;
var buffer1 = ArrayPool<byte>.Shared.Rent(bufferSize);
var buffer2 = ArrayPool<byte>.Shared.Rent(bufferSize);
try
{