Utility method to compare two byte arrays for equality : Byte Array « File Stream « C# / C Sharp
- C# / C Sharp
- File Stream
- Byte Array
Utility method to compare two byte arrays for equality
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
internal static class Util
{
internal static bool CompareBytes(byte[] lhs, byte[] rhs)
{
if (lhs.Length != rhs.Length)
{
return false;
}
for (int i = 0; i < lhs.Length; ++i)
{
if (lhs[i] != rhs[i])
{
return false;
}
}
return true;
}
}
Related examples in the same category