sebastienlachance
3/21/2011 - 6:10 PM

Comparing 2 byte array in C#

Comparing 2 byte array in C#

public static bool IsEquals(this byte[] o1, byte[] o2)
{
    if (o1 == null && o2 != null)
        return false;
    if (o1 != null && o2 == null)
        return false;
    if (o1 == null && o2 == null)
        return true;

    return o1.SequenceEqual(o2);
}