# WriteBytes

> Copy NativeArray of bytes into the writer's data buffer.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

## WriteBytes(NativeArray\<byte>)

Copy NativeArray of bytes into the writer's data buffer.

```csharp
public bool WriteBytes(NativeArray<byte> value)
```

### Parameters

**** (\[NativeArray\<byte>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): Source byte array

### Returns

| Type                                                          | Description                      |
| ------------------------------------------------------------- | -------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Whether the write was successful |

## WriteBytes(Span\<byte>)

Copy `Span` of bytes into the writer's data buffer.

```csharp
public bool WriteBytes(Span<byte> value)
```

### Parameters

**** (\[Span\<byte>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): Source byte span

### Returns

| Type                                                          | Description                      |
| ------------------------------------------------------------- | -------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Whether the write was successful |
