ArraysSupport

Properties

Link copied to clipboard

A soft maximum array length imposed by array growth computations. Some JVMs (such as HotSpot) have an implementation limit that will cause

Functions

Link copied to clipboard
fun mismatch(a: ByteArray, aFromIndex: Int, b: ByteArray, bFromIndex: Int, length: Int): Int

Finds the relative index of a mismatch between two arrays starting from the given indexes.

fun mismatch(a: CharArray, aFromIndex: Int, b: CharArray, bFromIndex: Int, length: Int): Int
fun mismatch(a: FloatArray, aFromIndex: Int, b: FloatArray, bFromIndex: Int, length: Int): Int

fun mismatch(a: IntArray, aFromIndex: Int, b: IntArray, bFromIndex: Int, length: Int): Int

Returns the relative index of the first mismatch between two subranges of the given arrays, or -1 if there is no mismatch.

fun mismatch(a: LongArray, aFromIndex: Int, b: LongArray, bFromIndex: Int, length: Int): Int

Returns the index of the first element that differs between the two LongArrays, starting at aFromIndex in a and bFromIndex in b, for up to length elements.

Link copied to clipboard
fun newLength(oldLength: Int, minGrowth: Int, prefGrowth: Int): Int

Computes a new array length given an array's current length, a minimum growth amount, and a preferred growth amount. The computation is done in an overflow-safe fashion.