JNIEnv.CopyArray Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| CopyArray(String[], IntPtr) |
Copies and converts managed strings into a Java object array, starting at index zero. |
| CopyArray(Single[], IntPtr) |
Copies a managed |
| CopyArray(IntPtr, UInt64[]) |
Copies element bit patterns from a Java |
| CopyArray(IntPtr, UInt32[]) |
Copies elements from a Java |
| CopyArray(IntPtr, UInt16[]) |
Copies element bit patterns from a Java |
| CopyArray(IntPtr, String[]) |
Copies and converts Java strings into a managed array, starting at index zero. |
| CopyArray(IntPtr, Single[]) |
Copies elements from a Java |
| CopyArray(IntPtr, Int64[]) |
Copies elements from a Java |
| CopyArray(IntPtr, Int32[]) |
Copies elements from a Java |
| CopyArray(IntPtr, Int16[]) |
Copies elements from a Java |
| CopyArray(IntPtr, Double[]) |
Copies elements from a Java |
| CopyArray(IntPtr, Byte[]) |
Copies element bit patterns from a Java |
| CopyArray(Array, Type, IntPtr) |
Copies a managed array into a Java array using the specified element type. |
| CopyArray(IntPtr, Boolean[]) |
Copies elements from a Java |
| CopyArray(Int64[], IntPtr) |
Copies a managed |
| CopyArray(Int32[], IntPtr) |
Copies a managed |
| CopyArray(Int16[], IntPtr) |
Copies a managed |
| CopyArray(Double[], IntPtr) |
Copies a managed |
| CopyArray(Char[], IntPtr) |
Copies a managed |
| CopyArray(Byte[], IntPtr) |
Copies element bit patterns from a managed |
| CopyArray(Boolean[], IntPtr) |
Copies a managed |
| CopyArray(IJavaObject[], IntPtr) |
Copies Java peer references from a managed array into a Java object array, starting at index zero. |
| CopyArray(IntPtr, Char[]) |
Copies elements from a Java |
| CopyArray(IntPtr, Array, Type) |
Copies and converts Java array elements into a managed array. |
| CopyArray<T>(IntPtr, T[]) |
Copies and converts Java array elements into a managed array. |
| CopyArray<T>(T[], IntPtr) |
Copies a managed array into a Java array using the managed element type. |
CopyArray(String[], IntPtr)
Copies and converts managed strings into a Java object array, starting at index zero.
public static void CopyArray(string[] src, IntPtr dest);
static member CopyArray : string[] * nativeint -> unit
Parameters
- src
- String[]
The non-null managed string array to copy. Null elements become Java null.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java object array that can contain strings, usable on the calling thread. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(Single[], IntPtr)
Copies a managed float[] into a Java float[], starting at index zero.
public static void CopyArray(float[] src, IntPtr dest);
static member CopyArray : single[] * nativeint -> unit
Parameters
- src
- Single[]
The managed float[] to copy. It must not be null.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java float[], usable on the calling thread until the call returns or throws. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, UInt64[])
Copies element bit patterns from a Java long[] into a managed ulong[], starting at index zero.
public static void CopyArray(IntPtr src, ulong[] dest);
static member CopyArray : nativeint * uint64[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live JNI reference to a Java long[], usable on the calling thread, or Zero. A nonzero source must contain at least as many elements as dest.
- dest
- UInt64[]
The managed ulong[] that receives the copied elements. It must not be null when src is nonzero.
Remarks
The pinned destination storage is passed to JNI as a pointer to signed 64-bit integers. No managed numeric conversion is performed.
Applies to
CopyArray(IntPtr, UInt32[])
Copies elements from a Java int[] into a managed uint[].
public static void CopyArray(IntPtr src, uint[] dest);
static member CopyArray : nativeint * uint32[] -> unit
Parameters
- dest
- UInt32[]
An unsigned integer array that receives the copied elements. It must not be null when src is nonzero.
Remarks
If src is zero, the method returns without copying. Otherwise, it requests as many elements as the destination length, starting at index zero. It passes the pinned destination storage to JNI as a pointer to signed 32-bit integers; it performs no managed numeric conversion.
Applies to
CopyArray(IntPtr, UInt16[])
Copies element bit patterns from a Java short[] into a managed ushort[], starting at index zero.
public static void CopyArray(IntPtr src, ushort[] dest);
static member CopyArray : nativeint * uint16[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live JNI reference to a Java short[], usable on the calling thread, or Zero. A nonzero source must contain at least as many elements as dest.
- dest
- UInt16[]
The managed ushort[] that receives the copied elements. It must not be null when src is nonzero.
Remarks
The pinned destination storage is passed to JNI as a pointer to signed 16-bit integers. No managed numeric conversion is performed.
Applies to
CopyArray(IntPtr, String[])
Copies and converts Java strings into a managed array, starting at index zero.
public static void CopyArray(IntPtr src, string[] dest);
static member CopyArray : nativeint * string[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live, non-null JNI reference to a Java object array whose copied elements are strings or null, usable on the calling thread. It must contain at least as many elements as dest.
- dest
- String[]
The non-null managed string array that receives the converted elements. Java null elements become null.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, Single[])
Copies elements from a Java float[] into a managed float[], starting at index zero.
public static void CopyArray(IntPtr src, float[] dest);
static member CopyArray : nativeint * single[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live JNI reference to a Java float[], usable on the calling thread, or Zero. A nonzero source must contain at least as many elements as dest.
- dest
- Single[]
The managed float[] that receives the copied elements. It must not be null when src is nonzero.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, Int64[])
Copies elements from a Java long[] into a managed long[], starting at index zero.
public static void CopyArray(IntPtr src, long[] dest);
static member CopyArray : nativeint * int64[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live JNI reference to a Java long[], usable on the calling thread, or Zero. A nonzero source must contain at least as many elements as dest.
- dest
- Int64[]
The managed long[] that receives the copied elements. It must not be null when src is nonzero.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, Int32[])
Copies elements from a Java int[] into a managed int[], starting at index zero.
public static void CopyArray(IntPtr src, int[] dest);
static member CopyArray : nativeint * int[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live JNI reference to a Java int[], usable on the calling thread, or Zero. A nonzero source must contain at least as many elements as dest.
- dest
- Int32[]
The managed int[] that receives the copied elements. It must not be null when src is nonzero.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, Int16[])
Copies elements from a Java short[] into a managed short[], starting at index zero.
public static void CopyArray(IntPtr src, short[] dest);
static member CopyArray : nativeint * int16[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live JNI reference to a Java short[], usable on the calling thread, or Zero. A nonzero source must contain at least as many elements as dest.
- dest
- Int16[]
The managed short[] that receives the copied elements. It must not be null when src is nonzero.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, Double[])
Copies elements from a Java double[] into a managed double[], starting at index zero.
public static void CopyArray(IntPtr src, double[] dest);
static member CopyArray : nativeint * double[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live JNI reference to a Java double[], usable on the calling thread, or Zero. A nonzero source must contain at least as many elements as dest.
- dest
- Double[]
The managed double[] that receives the copied elements. It must not be null when src is nonzero.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, Byte[])
Copies element bit patterns from a Java byte[] into a managed byte[], starting at index zero.
public static void CopyArray(IntPtr src, byte[] dest);
static member CopyArray : nativeint * byte[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live JNI reference to a Java byte[], usable on the calling thread, or Zero. A nonzero source must contain at least as many elements as dest.
- dest
- Byte[]
The managed byte[] that receives the copied elements. It must not be null when src is nonzero. Java signed-byte bit patterns are retained as unsigned bytes.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(Array, Type, IntPtr)
Copies a managed array into a Java array using the specified element type.
public static void CopyArray(Array source, Type elementType, IntPtr dest);
static member CopyArray : Array * Type * nativeint -> unit
Parameters
- source
- Array
The non-null managed array to copy.
- elementType
- Type
The non-null managed element type used to select a supported conversion.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a compatible Java array, usable on the calling thread. It must contain at least as many elements as source.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, Boolean[])
Copies elements from a Java boolean[] into a managed bool[], starting at index zero.
public static void CopyArray(IntPtr src, bool[] dest);
static member CopyArray : nativeint * bool[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live, non-null JNI reference to a Java boolean[], usable on the calling thread. It must contain at least as many elements as dest.
- dest
- Boolean[]
The non-null managed bool[] that receives the copied elements.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(Int64[], IntPtr)
Copies a managed long[] into a Java long[], starting at index zero.
public static void CopyArray(long[] src, IntPtr dest);
static member CopyArray : int64[] * nativeint -> unit
Parameters
- src
- Int64[]
The managed long[] to copy. It must not be null.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java long[], usable on the calling thread until the call returns or throws. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(Int32[], IntPtr)
Copies a managed int[] into a Java int[], starting at index zero.
public static void CopyArray(int[] src, IntPtr dest);
static member CopyArray : int[] * nativeint -> unit
Parameters
- src
- Int32[]
The managed int[] to copy. It must not be null.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java int[], usable on the calling thread until the call returns or throws. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(Int16[], IntPtr)
Copies a managed short[] into a Java short[], starting at index zero.
public static void CopyArray(short[] src, IntPtr dest);
static member CopyArray : int16[] * nativeint -> unit
Parameters
- src
- Int16[]
The managed short[] to copy. It must not be null.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java short[], usable on the calling thread until the call returns or throws. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(Double[], IntPtr)
Copies a managed double[] into a Java double[], starting at index zero.
public static void CopyArray(double[] src, IntPtr dest);
static member CopyArray : double[] * nativeint -> unit
Parameters
- src
- Double[]
The managed double[] to copy. It must not be null.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java double[], usable on the calling thread until the call returns or throws. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(Char[], IntPtr)
Copies a managed char[] into a Java char[], starting at index zero.
public static void CopyArray(char[] src, IntPtr dest);
static member CopyArray : char[] * nativeint -> unit
Parameters
- src
- Char[]
The managed char[] to copy. It must not be null.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java char[], usable on the calling thread until the call returns or throws. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(Byte[], IntPtr)
Copies element bit patterns from a managed byte[] into a Java byte[], starting at index zero.
public static void CopyArray(byte[] src, IntPtr dest);
static member CopyArray : byte[] * nativeint -> unit
Parameters
- src
- Byte[]
The managed byte[] to copy. It must not be null. Its unsigned byte bit patterns are passed to Java as signed bytes.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java byte[], usable on the calling thread until the call returns or throws. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(Boolean[], IntPtr)
Copies a managed bool[] into a Java boolean[], starting at index zero.
public static void CopyArray(bool[] src, IntPtr dest);
static member CopyArray : bool[] * nativeint -> unit
Parameters
- src
- Boolean[]
The managed bool[] to copy. It must not be null.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java boolean[], usable on the calling thread until the call returns or throws. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IJavaObject[], IntPtr)
Copies Java peer references from a managed array into a Java object array, starting at index zero.
public static void CopyArray(Android.Runtime.IJavaObject[] src, IntPtr dest);
static member CopyArray : Android.Runtime.IJavaObject[] * nativeint -> unit
Parameters
- src
- IJavaObject[]
The non-null managed array of Java peers to copy. Null elements become Java null. Non-null peers must have live JNI handles compatible with the destination element class.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a Java object array that can contain the source objects, usable on the calling thread. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, Char[])
Copies elements from a Java char[] into a managed char[], starting at index zero.
public static void CopyArray(IntPtr src, char[] dest);
static member CopyArray : nativeint * char[] -> unit
Parameters
- src
-
IntPtr
nativeint
A live JNI reference to a Java char[], usable on the calling thread, or Zero. A nonzero source must contain at least as many elements as dest.
- dest
- Char[]
The managed char[] that receives the copied elements. It must not be null when src is nonzero.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray(IntPtr, Array, Type)
Copies and converts Java array elements into a managed array.
public static void CopyArray(IntPtr src, Array dest, Type? elementType = default);
static member CopyArray : nativeint * Array * Type -> unit
Parameters
- src
-
IntPtr
nativeint
A live, non-null JNI reference to a supported Java array, usable on the calling thread. It must contain at least as many elements as dest.
- dest
- Array
The non-null managed array that receives the converted elements.
- elementType
- Type
The requested managed element type, or null to select a converter from the Java array type where supported.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray<T>(IntPtr, T[])
Copies and converts Java array elements into a managed array.
public static void CopyArray<T>(IntPtr src, T[] dest);
static member CopyArray : nativeint * 'T[] -> unit
Type Parameters
- T
The managed element type used to select a supported conversion.
Parameters
- src
-
IntPtr
nativeint
A live, non-null JNI reference to a compatible Java array, usable on the calling thread. It must contain at least as many elements as dest.
- dest
- T[]
The non-null managed array that receives the converted elements.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CopyArray<T>(T[], IntPtr)
Copies a managed array into a Java array using the managed element type.
public static void CopyArray<T>(T[] src, IntPtr dest);
static member CopyArray : 'T[] * nativeint -> unit
Type Parameters
- T
The managed element type used to select a supported conversion.
Parameters
- src
- T[]
The non-null managed array to copy.
- dest
-
IntPtr
nativeint
A live, non-null JNI reference to a compatible Java array, usable on the calling thread. It must contain at least as many elements as src.
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.