# ToShortArray

> Converts a managed array of System.Int16 to a Java array of \<tt\>short\</tt\>.

## Definition

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

## ToShortArray(short\[])

Converts a managed array of System.Int16 to a Java array of \\\<tt\\>short\\\</tt\\>.

```csharp
public static nint ToShortArray(short[] array)
```

### Parameters

**** (\[short\[]]\(https\://learn.microsoft.com/dotnet/api/system.int16)): 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 short. |

### Remarks

Additional Resources: [AndroidJNI.NewShortArray](/engine/7000.0/script-reference/unityengine/androidjni/newshortarray.md), [AndroidJNI.SetShortArrayElement](/engine/7000.0/script-reference/unityengine/androidjni/setshortarrayelement.md)

## ToShortArray(short\*, int)

Converts a managed array of System.Int16 to a Java array of \\\<tt\\>short\\\</tt\\>.

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

### Parameters

**** (\[short\*]\(https\://learn.microsoft.com/dotnet/api/system.int16)): 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 short. |

### Remarks

Additional Resources: [AndroidJNI.NewShortArray](/engine/7000.0/script-reference/unityengine/androidjni/newshortarray.md), [AndroidJNI.SetShortArrayElement](/engine/7000.0/script-reference/unityengine/androidjni/setshortarrayelement.md)
