# ToIntArray

> Converts a managed array of System.Int32 to a Java array of \<tt\>int\</tt\>.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AndroidJNIModule

## ToIntArray(int\[])

Converts a managed array of System.Int32 to a Java array of \\\<tt\\>int\\\</tt\\>.

```csharp
public static nint ToIntArray(int[] array)
```

### Parameters

**** (\[int\[]]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The managed array to convert.

### Returns

| Type                                                           | Description                                                   |
| -------------------------------------------------------------- | ------------------------------------------------------------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) | A local reference to the newly constructed Java array of int. |

### Remarks

Additional Resources: [AndroidJNI.NewIntArray](/engine/7000.0/script-reference/unityengine/androidjni/newintarray.md), [AndroidJNI.SetIntArrayElement](/engine/7000.0/script-reference/unityengine/androidjni/setintarrayelement.md)

## ToIntArray(int\*, int)

Converts a managed array of System.Int32 to a Java array of \\\<tt\\>int\\\</tt\\>.

```csharp
public static nint ToIntArray(int* array, int length)
```

### Parameters

**** (\[int\*]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The managed array to convert.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of elements in the array.

### Returns

| Type                                                           | Description                                                   |
| -------------------------------------------------------------- | ------------------------------------------------------------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) | A local reference to the newly constructed Java array of int. |

### Remarks

Additional Resources: [AndroidJNI.NewIntArray](/engine/7000.0/script-reference/unityengine/androidjni/newintarray.md), [AndroidJNI.SetIntArrayElement](/engine/7000.0/script-reference/unityengine/androidjni/setintarrayelement.md)
