# WriteAllBytes(string, byte[])

> Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.

## Definition

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

```csharp
public static void WriteAllBytes(string path, byte[] bytes)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file to write to.**** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)): The bytes to write to the file.
