# NativeStream.Reader

> Reads data from a buffer of a NativeStream.

## Definition

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

```csharp
public struct NativeStream.Reader
```

## Remarks

An individual reader can only be used for one buffer of one stream. Do not create more than one reader for an individual buffer.

## Properties

| Property                                                                                                          | Description                                         |
| ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| [ForEachCount](/engine/6000.7/script-reference/unity/collections/nativestream/reader/foreachcount.md)             | The number of buffers in the stream of this reader. |
| [RemainingItemCount](/engine/6000.7/script-reference/unity/collections/nativestream/reader/remainingitemcount.md) | The number of items not yet read from the buffer.   |

## Methods

| Method                                                                                                          | Description                                                                                               |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| [BeginForEachIndex](/engine/6000.7/script-reference/unity/collections/nativestream/reader/beginforeachindex.md) | Readies this reader to read a particular buffer of the stream.                                            |
| [Count](/engine/6000.7/script-reference/unity/collections/nativestream/reader/count.md)                         | Returns the total number of items in the buffers of the stream.                                           |
| [EndForEachIndex](/engine/6000.7/script-reference/unity/collections/nativestream/reader/endforeachindex.md)     | Checks if all data has been read from the buffer.                                                         |
| [GetUnsafeReader](/engine/6000.7/script-reference/unity/collections/nativestream/reader/getunsafereader.md)     | Returns the internal unsafe stream reader.                                                                |
| [Peek](/engine/6000.7/script-reference/unity/collections/nativestream/reader/peek.md)                           | Reads the next value from the buffer. Does not advance the reader.                                        |
| [Read](/engine/6000.7/script-reference/unity/collections/nativestream/reader/read.md)                           | Reads the next value from the buffer.                                                                     |
| [ReadUnsafePtr](/engine/6000.7/script-reference/unity/collections/nativestream/reader/readunsafeptr.md)         | Returns a pointer to the next position to read from the buffer. Advances the reader some number of bytes. |
