Skip to content

Instantly share code, notes, and snippets.

@sfeatherstone
Created March 5, 2018 16:15
Show Gist options
  • Save sfeatherstone/38903581114e6f0dc2ef78230a14d7a1 to your computer and use it in GitHub Desktop.
Save sfeatherstone/38903581114e6f0dc2ef78230a14d7a1 to your computer and use it in GitHub Desktop.
//Copy using arraycopy
fun catTwoIntArrays1(array1 :IntArray, array2 :IntArray) : IntArray {
val newArray = IntArray(array1.size + array2.size)
System.arraycopy(array1, 0, newArray, 0 , array1.size)
System.arraycopy(array2, 0, newArray, array1.size , array2.size)
return newArray
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment