Language

JniEnvironment.Arrays.GetPrimitiveArrayCritical Method

Definition

Obtains a primitive-array critical buffer. Keep the critical region short and avoid other JNI calls or blocking waits for Java threads.

public static IntPtr GetPrimitiveArrayCritical(Java.Interop.JniObjectReference array, bool* isCopy);
static member GetPrimitiveArrayCritical : Java.Interop.JniObjectReference * nativeptr<bool> -> nativeint

Parameters

array
JniObjectReference

A valid Java primitive-array reference, kept valid until final release.

isCopy
Boolean*

An optional pointer that receives true for a copied buffer and false for direct access.

Returns

IntPtr

nativeint

The buffer address, or zero if JNI fails. Pair a successful acquisition with ReleasePrimitiveArrayCritical.

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