ByteArrayKey

Represents a key based on a byte array. This class is primarily designed to be used as a key in collections such as Maps due to the proper implementation of equals and hashCode methods based on the byte array's content.

Parameters

bytes

The byte array that forms the basis of the key.

Constructors

Link copied to clipboard
constructor(bytes: ByteArray)

Creates a ByteArrayKey instance from the given byte array.

Properties

Link copied to clipboard
val size: Int

Represents the size of the byte array encapsulated by the ByteArrayKey instance.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Determines whether this object is equal to the specified object.

Link copied to clipboard
open override fun hashCode(): Int

Computes the hash code for the ByteArrayKey instance using the content-based hash code of the underlying byte array.

Link copied to clipboard
fun range(start: Int, end: Int): ByteArrayKey

Creates a new ByteArrayKey object containing a subrange of bytes from the current ByteArrayKey.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of the byte array encapsulated in the ByteArrayKey object.