# NewByteArray(int)

> Constructs a new primitive array object.

## Definition

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

> **Warning:**
>
> **Deprecated.** AndroidJNI.NewByteArray is obsolete. Use AndroidJNI.NewSByteArray method instead

```csharp
public static IntPtr NewByteArray(int size)
```

### Parameters

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

### Returns

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

### Remarks

[AndroidJNI.NewByteArray](/engine/6000.0/script-reference/unityengine/androidjni/newbytearray.md) is obsolete. Use [AndroidJNI.NewSByteArray](/engine/6000.0/script-reference/unityengine/androidjni/newsbytearray.md) instead.

Additional Resources: [Java Native Interface Specification (Oracle)](http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html)
