W3cubDocs

/Kotlin

copyOf

inline fun <T> Array<T>.copyOf(): Array<T>
inline fun ByteArray.copyOf(): ByteArray
inline fun ShortArray.copyOf(): ShortArray
inline fun IntArray.copyOf(): IntArray
inline fun LongArray.copyOf(): LongArray
inline fun FloatArray.copyOf(): FloatArray
inline fun DoubleArray.copyOf(): DoubleArray
inline fun BooleanArray.copyOf(): BooleanArray
inline fun CharArray.copyOf(): CharArray

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

inline fun ByteArray.copyOf(newSize: Int): ByteArray
inline fun ShortArray.copyOf(newSize: Int): ShortArray
inline fun IntArray.copyOf(newSize: Int): IntArray
inline fun LongArray.copyOf(newSize: Int): LongArray
inline fun FloatArray.copyOf(newSize: Int): FloatArray
inline fun DoubleArray.copyOf(newSize: Int): DoubleArray
inline fun BooleanArray.copyOf(newSize: Int): BooleanArray
inline fun CharArray.copyOf(newSize: Int): CharArray
inline fun <T> Array<T>.copyOf(newSize: Int): Array<T?>

Returns new array which is a copy of the original array, resized to the given newSize.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/copy-of.html