# ReadBytesUnsafe(ref DataStreamReader, byte*, int)

> Read and copy data to the memory location pointed to, an error will be logged if the length will put the reader out of bounds on the current read pointer.

## Definition

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

## ReadBytesUnsafe(DataStreamReader, byte\*, int)

```csharp
public static void ReadBytesUnsafe(this ref DataStreamReader reader, byte* data, int length)
```

### Parameters

**** (\[DataStreamReader]\(/engine/6000.7/script-reference/unity/collections/datastreamreader)): Data stream reader.**** (\[byte\*]\(https\://learn.microsoft.com/dotnet/api/system.byte)): Pointer to the data.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of bytes to read.
