# ReadAllBytes(string)

> Opens a binary file, reads the contents of the file into a byte array, and then closes the file.

## Definition

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

```csharp
public static byte[] ReadAllBytes(string path)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file to open for reading.

### Returns

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