Language

JNIEnv.GetArray Method

Definition

Overloads

Name Description
GetArray(IntPtr, JniHandleOwnership, Type)

Creates a managed array from a Java array.

GetArray<T>(Object[])

Converts an array of Java objects into a managed array.

GetArray<T>(IntPtr)

Copies a Java array into a new managed array.

GetArray(IntPtr, JniHandleOwnership, Type)

Creates a managed array from a Java array.

public static Array? GetArray(IntPtr array_ptr, Android.Runtime.JniHandleOwnership transfer, Type? element_type = default);
static member GetArray : nativeint * Android.Runtime.JniHandleOwnership * Type -> Array

Parameters

array_ptr
IntPtr

nativeint

A live JNI reference to a supported Java array, usable on the calling thread, or Zero.

transfer
JniHandleOwnership

Controls whether the method releases a local or global reference to array_ptr after conversion, including when conversion fails.

element_type
Type

The requested managed element type, or null to select a converter from the Java array type where supported.

Returns

The converted managed array, or null if array_ptr is zero.

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

GetArray<T>(Object[])

Converts an array of Java objects into a managed array.

public static T[]? GetArray<T>(Java.Lang.Object[] array);
static member GetArray : Java.Lang.Object[] -> 'T[]

Type Parameters

T

The managed element type to produce.

Parameters

array
Object[]

The managed array of Java objects to convert, or null.

Returns

T[]

A new array of converted elements, or null if array is 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

GetArray<T>(IntPtr)

Copies a Java array into a new managed array.

public static T[]? GetArray<T>(IntPtr array_ptr);
static member GetArray : nativeint -> 'T[]

Type Parameters

T

The managed element type.

Parameters

array_ptr
IntPtr

nativeint

A live JNI array reference usable on the calling thread, or Zero.

Returns

T[]

A managed array containing the converted elements, or null if array_ptr is Zero.

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