Table of Contents

Class ByteArrayEqualityComparer

Namespace
AsmResolver
Assembly
AsmResolver.dll

Provides an implementation to compare byte arrays for equality.

public class ByteArrayEqualityComparer : IEqualityComparer<byte[]>, IComparer<byte[]>
Inheritance
ByteArrayEqualityComparer
Implements
Inherited Members

Properties

Instance

Gets the singleton instance of this comparer.

public static ByteArrayEqualityComparer Instance { get; }

Property Value

ByteArrayEqualityComparer

Methods

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

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

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

Parameters

x byte[]

The first object to compare.

y byte[]

The second object to compare.

Returns

int

A signed integer that indicates the relative values of x and y, as shown in the following table.

Value Meaning
Less than zerox is less than y.
Zerox equals y.
Greater than zerox is greater than y.

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.

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.