copyOf

external fun <T> Array<T>.copyOf(): Array<T>(source)
external fun ByteArray.copyOf(): ByteArray(source)
external fun CharArray.copyOf(): CharArray(source)
external fun IntArray.copyOf(): IntArray(source)
external fun LongArray.copyOf(): LongArray(source)
external fun UIntArray.copyOf(): UIntArray(source)

Returns a new array containing the same elements.


external fun <T> Array<T>.copyOf(newSize: Int): Array<T?>(source)

Returns a resized copy, padding extra elements with null.


external fun BooleanArray.copyOf(newSize: Int): BooleanArray(source)

Returns a resized copy, padding extra elements with false.


external fun ByteArray.copyOf(newSize: Int): ByteArray(source)
external fun ShortArray.copyOf(newSize: Int): ShortArray(source)
external fun IntArray.copyOf(newSize: Int): IntArray(source)
external fun LongArray.copyOf(newSize: Int): LongArray(source)
external fun FloatArray.copyOf(newSize: Int): FloatArray(source)
external fun DoubleArray.copyOf(newSize: Int): DoubleArray(source)
external fun UByteArray.copyOf(newSize: Int): UByteArray(source)
external fun UShortArray.copyOf(newSize: Int): UShortArray(source)
external fun UIntArray.copyOf(newSize: Int): UIntArray(source)
external fun ULongArray.copyOf(newSize: Int): ULongArray(source)

Returns a resized copy, padding extra elements with zero.


external fun CharArray.copyOf(newSize: Int): CharArray(source)

Returns a resized copy, padding extra elements with zero characters.