public static bool CompareByteArray(byte[] bytes1, byte[] bytes2)
{
if (bytes1 == null || bytes2 == null)
{
if (bytes1 == null && bytes2 == null)
{
return true;
}
else
{
return false;
}
}
if (bytes1.Length == bytes2.Length)
{
for (int i = 0; i < bytes1.Length; i++)
{
if (bytes1[i] != bytes2[i])
{
return false;
}
}
}
else
{
return false;
}
return true;
}