Table of Contents

Class ByteArrayEqualityComparer

Namespace
Excalibur.Cdc.SqlServer
Assembly
Excalibur.Cdc.SqlServer.dll

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

x byte[]

The first object of type T to compare.

y byte[]

The second object of type T to compare.

Returns

bool

true if the specified objects are equal; otherwise, false.

Equals(object?, object?)

Determines whether the specified objects, which must be byte arrays, are equal.

public bool Equals(object? x, object? y)

Parameters

x object

The first object to compare. Must be a byte array.

y object

The second object to compare. Must be a byte array.

Returns

bool

true if the byte arrays are equal; otherwise, false.

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

obj byte[]

The object for which a hash code is to be returned.

Returns

int

A hash code for the specified object.

Exceptions

ArgumentNullException

The type of obj is a reference type and obj is null.

GetHashCode(object)

Returns a hash code for the specified object, which must be a byte array.

public int GetHashCode(object obj)

Parameters

obj object

The 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.