# ToShortArray

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

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.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 IntPtr ToShortArray(short[] array)
```

### Parameters

**** (\[short\[]]\(https\://learn.microsoft.com/dotnet/api/system.int16)):&#x20;

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### Remarks

Additional Resources: [AndroidJNI.NewShortArray](/engine/6000.0/script-reference/unityengine/androidjni/newshortarray.md), [AndroidJNI.SetShortArrayElement](/engine/6000.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 IntPtr ToShortArray(short* array, int length)
```

### Parameters

**** (\[short\*]\(https\://learn.microsoft.com/dotnet/api/system.int16)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### Remarks

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