# ToStream(Allocator)

> Copies the data collected in this instance into a new ObjectChangeEventStream instance.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public ObjectChangeEventStream ToStream(Allocator allocator)
```

### Parameters

**** (\[Allocator]\(/engine/6000.7/script-reference/unity/collections/allocator)): The allocator to use for the new stream.

### Returns

| Type                                                                                              | Description                                                                                       |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [ObjectChangeEventStream](/engine/6000.7/script-reference/unityeditor/objectchangeeventstream.md) | A new stream that contains all events recorded in this instance at the time of the function call. |

### Remarks

Calling this method does not affect the internal state of this instance. You can construct multiple independent streams from one builder.
