Table of Contents

Class ByteArrayComparer

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

Compares byte arrays lexicographically (byte-by-byte). Used for ordering LSN values.

public sealed class ByteArrayComparer : IComparer<byte[]>, IComparer
Inheritance
ByteArrayComparer
Implements
Inherited Members

Methods

Compare(byte[]?, byte[]?)

Compares two byte arrays lexicographically.

public int Compare(byte[]? x, byte[]? y)

Parameters

x byte[]

The first byte array to compare.

y byte[]

The second byte array to compare.

Returns

int

A negative value if x is less than y, zero if they are equal, or a positive value if x is greater than y.

Compare(object?, object?)

Compares two objects as byte arrays lexicographically.

public int Compare(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

int

A negative value if x is less than y, zero if they are equal, or a positive value if x is greater than y.

Exceptions

ArgumentException

Thrown when either argument is not a byte array.