How to use NativeStream?

I’ve been checking out the source for Unity Physics and I see this new NativeStream NativeContainer… I am new to this container so I looking to understand how to use it.

Thanks, input is appreciated.

1 Like

That explains nothing. There’s zero explanation of what NativeStream is supposed to be used for and how. None of the methods have any documentation beyond their name.

4 Likes

In the Collections package folder, under the tests folder there’s a set of tests for NativeStream in NativeStreamTests.cs. It demonstrates usage. There’s not really any proper documentation for it yet but the tests should make everything clear.

As for what it’s used for, from the package manual seems pretty clear:
A deterministic data stream supporting parallel reading and parallel writing. Allows you to write different types or arrays into a single stream.

You use it when you need to write then read data in parallel.

2 Likes