# WriteBytesUnsafe(ref DataStreamWriter, byte*, int)

> Appends a specified number of bytes from the buffer to the data stream.

## Definition

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

## WriteBytesUnsafe(DataStreamWriter, byte\*, int)

```csharp
public static bool WriteBytesUnsafe(this ref DataStreamWriter writer, byte* data, int bytes)
```

### Parameters

**** (\[DataStreamWriter]\(/engine/6000.7/script-reference/unity/collections/datastreamwriter)): Data stream writer.**** (\[byte\*]\(https\://learn.microsoft.com/dotnet/api/system.byte)): Pointer to the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A positive number of bytes to write.

### Returns

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