UByteArray

value class UByteArray : Collection<UByte>

Constructors

UByteArray
Link copied to clipboard
fun UByteArray(size: Int)

Creates a new array of the specified size, with all elements initialized to zero.

Functions

contains
Link copied to clipboard
open operator override fun contains(element: UByte): Boolean
containsAll
Link copied to clipboard
open override fun containsAll(elements: Collection<UByte>): Boolean
get
Link copied to clipboard
operator fun get(index: Int): UByte

Returns the array element at the given index. This method can be called using the index operator.

isEmpty
Link copied to clipboard
open override fun isEmpty(): Boolean
iterator
Link copied to clipboard
open operator override fun iterator(): Iterator<UByte>

Creates an iterator over the elements of the array.

set
Link copied to clipboard
operator fun set(index: Int, value: UByte)

Sets the element at the given index to the given value. This method can be called using the index operator.

Properties

size
Link copied to clipboard
open override val size: Int

Returns the number of elements in the array.

Extensions

all
Link copied to clipboard
inline fun UByteArray.all(predicate: (UByte) -> Boolean): Boolean

Returns true if all elements match the given predicate.

any
Link copied to clipboard
inline fun UByteArray.any(): Boolean

Returns true if array has at least one element.

inline fun UByteArray.any(predicate: (UByte) -> Boolean): Boolean

Returns true if at least one element matches the given predicate.

asByteArray
Link copied to clipboard
inline fun UByteArray.asByteArray(): ByteArray

Returns an array of type ByteArray, which is a view of this array where each element is a signed reinterpretation of the corresponding element of this array.

asList
Link copied to clipboard
expect fun UByteArray.asList(): List<UByte>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UByteArray.asList(): List<UByte>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UByteArray.asList(): List<UByte>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UByteArray.asList(): List<UByte>

Returns a List that wraps the original array.

associateWith
Link copied to clipboard
inline fun <V> UByteArray.associateWith(valueSelector: (UByte) -> V): Map<UByte, V>

Returns a Map where keys are elements from the given array and values are produced by the valueSelector function applied to each element.

associateWithTo
Link copied to clipboard
inline fun <V, M : MutableMap<in UByte, in V>> UByteArray.associateWithTo(destination: M, valueSelector: (UByte) -> V): M

Populates and returns the destination mutable map with key-value pairs for each element of the given array, where key is the element itself and value is provided by the valueSelector function applied to that key.

binarySearch
Link copied to clipboard
@ExperimentalUnsignedTypes
fun UByteArray.binarySearch(element: UByte, fromIndex: Int = 0, toIndex: Int = size): Int

Searches the array or the range of the array for the provided element using the binary search algorithm. The array is expected to be sorted, otherwise the result is undefined.

component1
Link copied to clipboard
inline operator fun UByteArray.component1(): UByte

Returns 1st element from the array.

component2
Link copied to clipboard
inline operator fun UByteArray.component2(): UByte

Returns 2nd element from the array.

component3
Link copied to clipboard
inline operator fun UByteArray.component3(): UByte

Returns 3rd element from the array.

component4
Link copied to clipboard
inline operator fun UByteArray.component4(): UByte

Returns 4th element from the array.

component5
Link copied to clipboard
inline operator fun UByteArray.component5(): UByte

Returns 5th element from the array.

contentEquals
Link copied to clipboard
infix fun UByteArray.contentEquals(other: UByteArray): Boolean
infix fun UByteArray?.contentEquals(other: UByteArray?): Boolean

Returns true if the two specified arrays are structurally equal to one another, i.e. contain the same number of the same elements in the same order.

contentHashCode
Link copied to clipboard
fun UByteArray.contentHashCode(): Int
fun UByteArray?.contentHashCode(): Int

Returns a hash code based on the contents of this array as if it is List.

contentToString
Link copied to clipboard
fun UByteArray.contentToString(): String
fun UByteArray?.contentToString(): String

Returns a string representation of the contents of the specified array as if it is List.

copyInto
Link copied to clipboard
inline fun UByteArray.copyInto(destination: UByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UByteArray

Copies this array or its subrange into the destination array and returns that array.

copyOf
Link copied to clipboard
inline fun UByteArray.copyOf(): UByteArray

Returns new array which is a copy of the original array.

inline fun UByteArray.copyOf(newSize: Int): UByteArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with zero values if necessary.

copyOfRange
Link copied to clipboard
inline fun UByteArray.copyOfRange(fromIndex: Int, toIndex: Int): UByteArray

Returns a new array which is a copy of the specified range of the original array.

count
Link copied to clipboard
inline fun UByteArray.count(predicate: (UByte) -> Boolean): Int

Returns the number of elements matching the given predicate.

drop
Link copied to clipboard
fun UByteArray.drop(n: Int): List<UByte>

Returns a list containing all elements except first n elements.

dropLast
Link copied to clipboard
fun UByteArray.dropLast(n: Int): List<UByte>

Returns a list containing all elements except last n elements.

dropLastWhile
Link copied to clipboard
inline fun UByteArray.dropLastWhile(predicate: (UByte) -> Boolean): List<UByte>

Returns a list containing all elements except last elements that satisfy the given predicate.

dropWhile
Link copied to clipboard
inline fun UByteArray.dropWhile(predicate: (UByte) -> Boolean): List<UByte>

Returns a list containing all elements except first elements that satisfy the given predicate.

elementAt
Link copied to clipboard
expect fun UByteArray.elementAt(index: Int): UByte

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.

@ExperimentalUnsignedTypes
actual inline fun UByteArray.elementAt(index: Int): UByte

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.

@ExperimentalUnsignedTypes
actual fun UByteArray.elementAt(index: Int): UByte

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.

@ExperimentalUnsignedTypes
actual inline fun UByteArray.elementAt(index: Int): UByte

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.

elementAtOrElse
Link copied to clipboard
inline fun UByteArray.elementAtOrElse(index: Int, defaultValue: (Int) -> UByte): UByte

Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this array.

elementAtOrNull
Link copied to clipboard
inline fun UByteArray.elementAtOrNull(index: Int): UByte?

Returns an element at the given index or null if the index is out of bounds of this array.

fill
Link copied to clipboard
fun UByteArray.fill(element: UByte, fromIndex: Int = 0, toIndex: Int = size)

Fills this array or its subrange with the specified element value.

filter
Link copied to clipboard
inline fun UByteArray.filter(predicate: (UByte) -> Boolean): List<UByte>

Returns a list containing only elements matching the given predicate.

filterIndexed
Link copied to clipboard
inline fun UByteArray.filterIndexed(predicate: (index: Int, UByte) -> Boolean): List<UByte>

Returns a list containing only elements matching the given predicate.

filterIndexedTo
Link copied to clipboard
inline fun <C : MutableCollection<in UByte>> UByteArray.filterIndexedTo(destination: C, predicate: (index: Int, UByte) -> Boolean): C

Appends all elements matching the given predicate to the given destination.

filterNot
Link copied to clipboard
inline fun UByteArray.filterNot(predicate: (UByte) -> Boolean): List<UByte>

Returns a list containing all elements not matching the given predicate.

filterNotTo
Link copied to clipboard
inline fun <C : MutableCollection<in UByte>> UByteArray.filterNotTo(destination: C, predicate: (UByte) -> Boolean): C

Appends all elements not matching the given predicate to the given destination.

filterTo
Link copied to clipboard
inline fun <C : MutableCollection<in UByte>> UByteArray.filterTo(destination: C, predicate: (UByte) -> Boolean): C

Appends all elements matching the given predicate to the given destination.

find
Link copied to clipboard
inline fun UByteArray.find(predicate: (UByte) -> Boolean): UByte?

Returns the first element matching the given predicate, or null if no such element was found.

findLast
Link copied to clipboard
inline fun UByteArray.findLast(predicate: (UByte) -> Boolean): UByte?

Returns the last element matching the given predicate, or null if no such element was found.

first
Link copied to clipboard
inline fun UByteArray.first(): UByte

Returns first element.

inline fun UByteArray.first(predicate: (UByte) -> Boolean): UByte

Returns the first element matching the given predicate.

firstOrNull
Link copied to clipboard
fun UByteArray.firstOrNull(): UByte?

Returns the first element, or null if the array is empty.

inline fun UByteArray.firstOrNull(predicate: (UByte) -> Boolean): UByte?

Returns the first element matching the given predicate, or null if element was not found.

flatMap
Link copied to clipboard
inline fun <R> UByteArray.flatMap(transform: (UByte) -> Iterable<R>): List<R>

Returns a single list of all elements yielded from results of transform function being invoked on each element of original array.

flatMapIndexed
Link copied to clipboard
inline fun <R> UByteArray.flatMapIndexed(transform: (index: Int, UByte) -> Iterable<R>): List<R>

Returns a single list of all elements yielded from results of transform function being invoked on each element and its index in the original array.

flatMapIndexedTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> UByteArray.flatMapIndexedTo(destination: C, transform: (index: Int, UByte) -> Iterable<R>): C

Appends all elements yielded from results of transform function being invoked on each element and its index in the original array, to the given destination.

flatMapTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> UByteArray.flatMapTo(destination: C, transform: (UByte) -> Iterable<R>): C

Appends all elements yielded from results of transform function being invoked on each element of original array, to the given destination.

fold
Link copied to clipboard
inline fun <R> UByteArray.fold(initial: R, operation: (R, UByte) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element.

foldIndexed
Link copied to clipboard
inline fun <R> UByteArray.foldIndexed(initial: R, operation: (index: Int, R, UByte) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element with its index in the original array.

foldRight
Link copied to clipboard
inline fun <R> UByteArray.foldRight(initial: R, operation: (UByte, R) -> R): R

Accumulates value starting with initial value and applying operation from right to left to each element and current accumulator value.

foldRightIndexed
Link copied to clipboard
inline fun <R> UByteArray.foldRightIndexed(initial: R, operation: (index: Int, UByte, R) -> R): R

Accumulates value starting with initial value and applying operation from right to left to each element with its index in the original array and current accumulator value.

forEach
Link copied to clipboard
inline fun UByteArray.forEach(action: (UByte) -> Unit)

Performs the given action on each element.

forEachIndexed
Link copied to clipboard
inline fun UByteArray.forEachIndexed(action: (index: Int, UByte) -> Unit)

Performs the given action on each element, providing sequential index with the element.

getOrElse
Link copied to clipboard
inline fun UByteArray.getOrElse(index: Int, defaultValue: (Int) -> UByte): UByte

Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this array.

getOrNull
Link copied to clipboard
fun UByteArray.getOrNull(index: Int): UByte?

Returns an element at the given index or null if the index is out of bounds of this array.

groupBy
Link copied to clipboard
inline fun <K> UByteArray.groupBy(keySelector: (UByte) -> K): Map<K, List<UByte>>

Groups elements of the original array by the key returned by the given keySelector function applied to each element and returns a map where each group key is associated with a list of corresponding elements.

inline fun <K, V> UByteArray.groupBy(keySelector: (UByte) -> K, valueTransform: (UByte) -> V): Map<K, List<V>>

Groups values returned by the valueTransform function applied to each element of the original array by the key returned by the given keySelector function applied to the element and returns a map where each group key is associated with a list of corresponding values.

groupByTo
Link copied to clipboard
inline fun <K, M : MutableMap<in K, MutableList<UByte>>> UByteArray.groupByTo(destination: M, keySelector: (UByte) -> K): M

Groups elements of the original array by the key returned by the given keySelector function applied to each element and puts to the destination map each group key associated with a list of corresponding elements.

inline fun <K, V, M : MutableMap<in K, MutableList<V>>> UByteArray.groupByTo(destination: M, keySelector: (UByte) -> K, valueTransform: (UByte) -> V): M

Groups values returned by the valueTransform function applied to each element of the original array by the key returned by the given keySelector function applied to the element and puts to the destination map each group key associated with a list of corresponding values.

indexOf
Link copied to clipboard
inline fun UByteArray.indexOf(element: UByte): Int

Returns first index of element, or -1 if the array does not contain element.

indexOfFirst
Link copied to clipboard
inline fun UByteArray.indexOfFirst(predicate: (UByte) -> Boolean): Int

Returns index of the first element matching the given predicate, or -1 if the array does not contain such element.

indexOfLast
Link copied to clipboard
inline fun UByteArray.indexOfLast(predicate: (UByte) -> Boolean): Int

Returns index of the last element matching the given predicate, or -1 if the array does not contain such element.

indices
Link copied to clipboard
val UByteArray.indices: IntRange

Returns the range of valid indices for the array.

last
Link copied to clipboard
inline fun UByteArray.last(): UByte

Returns the last element.

inline fun UByteArray.last(predicate: (UByte) -> Boolean): UByte

Returns the last element matching the given predicate.

lastIndex
Link copied to clipboard
val UByteArray.lastIndex: Int

Returns the last valid index for the array.

lastIndexOf
Link copied to clipboard
inline fun UByteArray.lastIndexOf(element: UByte): Int

Returns last index of element, or -1 if the array does not contain element.

lastOrNull
Link copied to clipboard
fun UByteArray.lastOrNull(): UByte?

Returns the last element, or null if the array is empty.

inline fun UByteArray.lastOrNull(predicate: (UByte) -> Boolean): UByte?

Returns the last element matching the given predicate, or null if no such element was found.

map
Link copied to clipboard
inline fun <R> UByteArray.map(transform: (UByte) -> R): List<R>

Returns a list containing the results of applying the given transform function to each element in the original array.

mapIndexed
Link copied to clipboard
inline fun <R> UByteArray.mapIndexed(transform: (index: Int, UByte) -> R): List<R>

Returns a list containing the results of applying the given transform function to each element and its index in the original array.

mapIndexedTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> UByteArray.mapIndexedTo(destination: C, transform: (index: Int, UByte) -> R): C

Applies the given transform function to each element and its index in the original array and appends the results to the given destination.

mapTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> UByteArray.mapTo(destination: C, transform: (UByte) -> R): C

Applies the given transform function to each element of the original array and appends the results to the given destination.

max
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UByteArray.max(): UByte?
maxBy
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UByteArray.maxBy(selector: (UByte) -> R): UByte?
maxByOrNull
Link copied to clipboard
inline fun <R : Comparable<R>> UByteArray.maxByOrNull(selector: (UByte) -> R): UByte?

Returns the first element yielding the largest value of the given function or null if there are no elements.

maxOf
Link copied to clipboard
inline fun UByteArray.maxOf(selector: (UByte) -> Double): Double
inline fun UByteArray.maxOf(selector: (UByte) -> Float): Float
inline fun <R : Comparable<R>> UByteArray.maxOf(selector: (UByte) -> R): R

Returns the largest value among all values produced by selector function applied to each element in the array.

maxOfOrNull
Link copied to clipboard
inline fun UByteArray.maxOfOrNull(selector: (UByte) -> Double): Double?
inline fun UByteArray.maxOfOrNull(selector: (UByte) -> Float): Float?
inline fun <R : Comparable<R>> UByteArray.maxOfOrNull(selector: (UByte) -> R): R?

Returns the largest value among all values produced by selector function applied to each element in the array or null if there are no elements.

maxOfWith
Link copied to clipboard
inline fun <R> UByteArray.maxOfWith(comparator: Comparator<in R>, selector: (UByte) -> R): R

Returns the largest value according to the provided comparator among all values produced by selector function applied to each element in the array.

maxOfWithOrNull
Link copied to clipboard
inline fun <R> UByteArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (UByte) -> R): R?

Returns the largest value according to the provided comparator among all values produced by selector function applied to each element in the array or null if there are no elements.

maxOrNull
Link copied to clipboard
fun UByteArray.maxOrNull(): UByte?

Returns the largest element or null if there are no elements.

maxWith
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UByteArray.maxWith(comparator: Comparator<in UByte>): UByte?
maxWithOrNull
Link copied to clipboard
fun UByteArray.maxWithOrNull(comparator: Comparator<in UByte>): UByte?

Returns the first element having the largest value according to the provided comparator or null if there are no elements.

min
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UByteArray.min(): UByte?
minBy
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UByteArray.minBy(selector: (UByte) -> R): UByte?
minByOrNull
Link copied to clipboard
inline fun <R : Comparable<R>> UByteArray.minByOrNull(selector: (UByte) -> R): UByte?

Returns the first element yielding the smallest value of the given function or null if there are no elements.

minOf
Link copied to clipboard
inline fun UByteArray.minOf(selector: (UByte) -> Double): Double
inline fun UByteArray.minOf(selector: (UByte) -> Float): Float
inline fun <R : Comparable<R>> UByteArray.minOf(selector: (UByte) -> R): R

Returns the smallest value among all values produced by selector function applied to each element in the array.

minOfOrNull
Link copied to clipboard
inline fun UByteArray.minOfOrNull(selector: (UByte) -> Double): Double?
inline fun UByteArray.minOfOrNull(selector: (UByte) -> Float): Float?
inline fun <R : Comparable<R>> UByteArray.minOfOrNull(selector: (UByte) -> R): R?

Returns the smallest value among all values produced by selector function applied to each element in the array or null if there are no elements.

minOfWith
Link copied to clipboard
inline fun <R> UByteArray.minOfWith(comparator: Comparator<in R>, selector: (UByte) -> R): R

Returns the smallest value according to the provided comparator among all values produced by selector function applied to each element in the array.

minOfWithOrNull
Link copied to clipboard
inline fun <R> UByteArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (UByte) -> R): R?

Returns the smallest value according to the provided comparator among all values produced by selector function applied to each element in the array or null if there are no elements.

minOrNull
Link copied to clipboard
fun UByteArray.minOrNull(): UByte?

Returns the smallest element or null if there are no elements.

minWith
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UByteArray.minWith(comparator: Comparator<in UByte>): UByte?
minWithOrNull
Link copied to clipboard
fun UByteArray.minWithOrNull(comparator: Comparator<in UByte>): UByte?

Returns the first element having the smallest value according to the provided comparator or null if there are no elements.

none
Link copied to clipboard
inline fun UByteArray.none(): Boolean

Returns true if the array has no elements.

inline fun UByteArray.none(predicate: (UByte) -> Boolean): Boolean

Returns true if no elements match the given predicate.

onEach
Link copied to clipboard
inline fun UByteArray.onEach(action: (UByte) -> Unit): UByteArray

Performs the given action on each element and returns the array itself afterwards.

onEachIndexed
Link copied to clipboard
inline fun UByteArray.onEachIndexed(action: (index: Int, UByte) -> Unit): UByteArray

Performs the given action on each element, providing sequential index with the element, and returns the array itself afterwards.

plus
Link copied to clipboard
inline operator fun UByteArray.plus(element: UByte): UByteArray

Returns an array containing all elements of the original array and then the given element.

operator fun UByteArray.plus(elements: Collection<UByte>): UByteArray

Returns an array containing all elements of the original array and then all elements of the given elements collection.

inline operator fun UByteArray.plus(elements: UByteArray): UByteArray

Returns an array containing all elements of the original array and then all elements of the given elements array.

random
Link copied to clipboard
inline fun UByteArray.random(): UByte

Returns a random element from this array.

fun UByteArray.random(random: Random): UByte

Returns a random element from this array using the specified source of randomness.

randomOrNull
Link copied to clipboard
inline fun UByteArray.randomOrNull(): UByte?

Returns a random element from this array, or null if this array is empty.

fun UByteArray.randomOrNull(random: Random): UByte?

Returns a random element from this array using the specified source of randomness, or null if this array is empty.

reduce
Link copied to clipboard
inline fun UByteArray.reduce(operation: (acc: UByte, UByte) -> UByte): UByte

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.

reduceIndexed
Link copied to clipboard
inline fun UByteArray.reduceIndexed(operation: (index: Int, acc: UByte, UByte) -> UByte): UByte

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element with its index in the original array.

reduceIndexedOrNull
Link copied to clipboard
inline fun UByteArray.reduceIndexedOrNull(operation: (index: Int, acc: UByte, UByte) -> UByte): UByte?

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element with its index in the original array.

reduceOrNull
Link copied to clipboard
inline fun UByteArray.reduceOrNull(operation: (acc: UByte, UByte) -> UByte): UByte?

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.

reduceRight
Link copied to clipboard
inline fun UByteArray.reduceRight(operation: (UByte, acc: UByte) -> UByte): UByte

Accumulates value starting with the last element and applying operation from right to left to each element and current accumulator value.

reduceRightIndexed
Link copied to clipboard
inline fun UByteArray.reduceRightIndexed(operation: (index: Int, UByte, acc: UByte) -> UByte): UByte

Accumulates value starting with the last element and applying operation from right to left to each element with its index in the original array and current accumulator value.

reduceRightIndexedOrNull
Link copied to clipboard
inline fun UByteArray.reduceRightIndexedOrNull(operation: (index: Int, UByte, acc: UByte) -> UByte): UByte?

Accumulates value starting with the last element and applying operation from right to left to each element with its index in the original array and current accumulator value.

reduceRightOrNull
Link copied to clipboard
inline fun UByteArray.reduceRightOrNull(operation: (UByte, acc: UByte) -> UByte): UByte?

Accumulates value starting with the last element and applying operation from right to left to each element and current accumulator value.

refTo
Link copied to clipboard
fun UByteArray.refTo(index: Int): CValuesRef<UByteVar>
reverse
Link copied to clipboard
inline fun UByteArray.reverse()

Reverses elements in the array in-place.

inline fun UByteArray.reverse(fromIndex: Int, toIndex: Int)

Reverses elements of the array in the specified range in-place.

reversed
Link copied to clipboard
fun UByteArray.reversed(): List<UByte>

Returns a list with elements in reversed order.

reversedArray
Link copied to clipboard
inline fun UByteArray.reversedArray(): UByteArray

Returns an array with elements of this array in reversed order.

runningFold
Link copied to clipboard
inline fun <R> UByteArray.runningFold(initial: R, operation: (R, UByte) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with initial value.

runningFoldIndexed
Link copied to clipboard
inline fun <R> UByteArray.runningFoldIndexed(initial: R, operation: (index: Int, R, UByte) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with initial value.

runningReduce
Link copied to clipboard
inline fun UByteArray.runningReduce(operation: (acc: UByte, UByte) -> UByte): List<UByte>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with the first element of this array.

runningReduceIndexed
Link copied to clipboard
inline fun UByteArray.runningReduceIndexed(operation: (index: Int, acc: UByte, UByte) -> UByte): List<UByte>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with the first element of this array.

scan
Link copied to clipboard
inline fun <R> UByteArray.scan(initial: R, operation: (R, UByte) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with initial value.

scanIndexed
Link copied to clipboard
inline fun <R> UByteArray.scanIndexed(initial: R, operation: (index: Int, R, UByte) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with initial value.

shuffle
Link copied to clipboard
fun UByteArray.shuffle()

Randomly shuffles elements in this array in-place.

fun UByteArray.shuffle(random: Random)

Randomly shuffles elements in this array in-place using the specified random instance as the source of randomness.

single
Link copied to clipboard
inline fun UByteArray.single(): UByte

Returns the single element, or throws an exception if the array is empty or has more than one element.

inline fun UByteArray.single(predicate: (UByte) -> Boolean): UByte

Returns the single element matching the given predicate, or throws exception if there is no or more than one matching element.

singleOrNull
Link copied to clipboard
fun UByteArray.singleOrNull(): UByte?

Returns single element, or null if the array is empty or has more than one element.

inline fun UByteArray.singleOrNull(predicate: (UByte) -> Boolean): UByte?

Returns the single element matching the given predicate, or null if element was not found or more than one element was found.

slice
Link copied to clipboard
fun UByteArray.slice(indices: IntRange): List<UByte>

Returns a list containing elements at indices in the specified indices range.

fun UByteArray.slice(indices: Iterable<Int>): List<UByte>

Returns a list containing elements at specified indices.

sliceArray
Link copied to clipboard
fun UByteArray.sliceArray(indices: Collection<Int>): UByteArray

Returns an array containing elements of this array at specified indices.

fun UByteArray.sliceArray(indices: IntRange): UByteArray

Returns an array containing elements at indices in the specified indices range.

sort
Link copied to clipboard
fun UByteArray.sort()

Sorts the array in-place.

fun UByteArray.sort(fromIndex: Int = 0, toIndex: Int = size)

Sorts a range in the array in-place.

sortDescending
Link copied to clipboard
fun UByteArray.sortDescending()

Sorts elements in the array in-place descending according to their natural sort order.

fun UByteArray.sortDescending(fromIndex: Int, toIndex: Int)

Sorts elements of the array in the specified range in-place. The elements are sorted descending according to their natural sort order.

sorted
Link copied to clipboard
fun UByteArray.sorted(): List<UByte>

Returns a list of all elements sorted according to their natural sort order.

sortedArray
Link copied to clipboard

Returns an array with all elements of this array sorted according to their natural sort order.

sortedArrayDescending
Link copied to clipboard

Returns an array with all elements of this array sorted descending according to their natural sort order.

sortedDescending
Link copied to clipboard

Returns a list of all elements sorted descending according to their natural sort order.

sum
Link copied to clipboard
inline fun UByteArray.sum(): UInt

Returns the sum of all elements in the array.

sumBy
Link copied to clipboard
inline fun UByteArray.sumBy(selector: (UByte) -> UInt): UInt

Returns the sum of all values produced by selector function applied to each element in the array.

sumByDouble
Link copied to clipboard
inline fun UByteArray.sumByDouble(selector: (UByte) -> Double): Double

Returns the sum of all values produced by selector function applied to each element in the array.

sumOf
Link copied to clipboard
@JvmName(name = "sumOfDouble")
inline fun UByteArray.sumOf(selector: (UByte) -> Double): Double
inline fun UByteArray.sumOf(selector: (UByte) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun UByteArray.sumOf(selector: (UByte) -> Long): Long
@JvmName(name = "sumOfUInt")
inline fun UByteArray.sumOf(selector: (UByte) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun UByteArray.sumOf(selector: (UByte) -> ULong): ULong

Returns the sum of all values produced by selector function applied to each element in the array.

@JvmName(name = "sumOfBigDecimal")
@ExperimentalUnsignedTypes
inline fun UByteArray.sumOf(selector: (UByte) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
@ExperimentalUnsignedTypes
inline fun UByteArray.sumOf(selector: (UByte) -> BigInteger): BigInteger

Returns the sum of all values produced by selector function applied to each element in the array.

take
Link copied to clipboard
fun UByteArray.take(n: Int): List<UByte>

Returns a list containing first n elements.

takeLast
Link copied to clipboard
fun UByteArray.takeLast(n: Int): List<UByte>

Returns a list containing last n elements.

takeLastWhile
Link copied to clipboard
inline fun UByteArray.takeLastWhile(predicate: (UByte) -> Boolean): List<UByte>

Returns a list containing last elements satisfying the given predicate.

takeWhile
Link copied to clipboard
inline fun UByteArray.takeWhile(predicate: (UByte) -> Boolean): List<UByte>

Returns a list containing first elements satisfying the given predicate.

toByteArray
Link copied to clipboard
inline fun UByteArray.toByteArray(): ByteArray

Returns an array of type ByteArray, which is a copy of this array where each element is a signed reinterpretation of the corresponding element of this array.

toCValues
Link copied to clipboard
fun UByteArray.toCValues(): CValues<UByteVar>
toTypedArray
Link copied to clipboard
fun UByteArray.toTypedArray(): Array<UByte>

Returns a typed object array containing all of the elements of this primitive array.

withIndex
Link copied to clipboard

Returns a lazy Iterable that wraps each element of the original array into an IndexedValue containing the index of that element and the element itself.

zip
Link copied to clipboard
infix fun <R> UByteArray.zip(other: Array<out R>): List<Pair<UByte, R>>
infix fun UByteArray.zip(other: UByteArray): List<Pair<UByte, UByte>>

Returns a list of pairs built from the elements of this array and the other array with the same index. The returned list has length of the shortest collection.

inline fun <R, V> UByteArray.zip(other: Array<out R>, transform: (a: UByte, R) -> V): List<V>

Returns a list of values built from the elements of this array and the other array with the same index using the provided transform function applied to each pair of elements. The returned list has length of the shortest collection.

infix fun <R> UByteArray.zip(other: Iterable<R>): List<Pair<UByte, R>>

Returns a list of pairs built from the elements of this collection and other array with the same index. The returned list has length of the shortest collection.

inline fun <R, V> UByteArray.zip(other: Iterable<R>, transform: (a: UByte, R) -> V): List<V>

Returns a list of values built from the elements of this array and the other collection with the same index using the provided transform function applied to each pair of elements. The returned list has length of the shortest collection.

inline fun <V> UByteArray.zip(other: UByteArray, transform: (a: UByte, b: UByte) -> V): List<V>

Returns a list of values built from the elements of this array and the other array with the same index using the provided transform function applied to each pair of elements. The returned list has length of the shortest array.