Class ByteArrayEqualityComparer
Compares byte arrays for equality and provides a consistent hash code implementation. Intended for dictionary key comparisons where byte arrays represent LSNs or sequence values.
public sealed class ByteArrayEqualityComparer : IEqualityComparer<byte[]>, IEqualityComparer
- Inheritance
-
ByteArrayEqualityComparer
- Implements
- Inherited Members
Methods
Equals(byte[]?, byte[]?)
Determines whether the specified objects are equal.
public bool Equals(byte[]? x, byte[]? y)
Parameters
Returns
Equals(object?, object?)
Determines whether the specified objects, which must be byte arrays, are equal.
public bool Equals(object? x, object? y)
Parameters
xobjectThe first object to compare. Must be a byte array.
yobjectThe second object to compare. Must be a byte array.
Returns
Exceptions
- ArgumentException
Thrown when either argument is not a byte array.
GetHashCode(byte[])
Returns a hash code for the specified object.
public int GetHashCode(byte[] obj)
Parameters
Returns
- int
A hash code for the specified object.
Exceptions
- ArgumentNullException
The type of
objis a reference type andobjis null.
GetHashCode(object)
Returns a hash code for the specified object, which must be a byte array.
public int GetHashCode(object obj)
Parameters
objobjectThe object for which to get a hash code.
Returns
- int
A hash code for the byte array.
Exceptions
- ArgumentException
Thrown when the argument is not a byte array.