byte[] sourceArray = { 1, 2, 3, 4, 5 }; byte[] destinationArray = new byte[5]; JNIEnv.CopyArray(sourceArray, destinationArray, sourceArray.Length);
int[] sourceArray = { 10, 20, 30, 40, 50 }; int[] destinationArray = new int[5]; JniEnvironment.Instance.CopyArray(sourceArray, destinationArray, sourceArray.Length);This example uses the JniEnvironment class to access the JNIEnv.CopyArray method to copy the contents of the sourceArray int array to the destinationArray int array. In both examples, the JNIEnv.CopyArray method is used to copy the values from the source array to the destination array. This method is part of the Android.Runtime namespace, which is included in the Xamarin.Android package.