Class ByteArrayComparer
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
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
xobjectThe first object to compare. Must be a byte array.
yobjectThe 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.