# ToSByteArray

> Converts a managed array of System.SByte to a Java array of \<tt\>byte\</tt\>.

## Definition

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

## ToSByteArray(sbyte\[])

Converts a managed array of System.SByte to a Java array of \\\<tt\\>byte\\\</tt\\>.

```csharp
public static nint ToSByteArray(sbyte[] array)
```

### Parameters

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

### Remarks

Additional Resources: [AndroidJNI.NewSByteArray](/engine/7000.0/script-reference/unityengine/androidjni/newsbytearray.md), [AndroidJNI.SetSByteArrayElement](/engine/7000.0/script-reference/unityengine/androidjni/setsbytearrayelement.md)

## ToSByteArray(sbyte\*, int)

Converts a managed array of `System.SByte` to a Java array of `byte`.

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

### Parameters

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

### Remarks

Additional Resources: [AndroidJNI.NewSByteArray](/engine/7000.0/script-reference/unityengine/androidjni/newsbytearray.md), [AndroidJNI.SetSByteArrayElement](/engine/7000.0/script-reference/unityengine/androidjni/setsbytearrayelement.md)
