[]
        
(Showing Draft Content)

C1.Util.DX.DataStream.Create

Create Method

Create<T>(T[], bool, bool, int, bool)

Initializes a new instance of the DataStream class, using a managed buffer as a backing store.

Declaration
public static DataStream Create<T>(T[] userBuffer, bool canRead, bool canWrite, int index = 0, bool pinBuffer = true) where T : struct
Parameters
Type Name Description
T[] userBuffer

A managed array to be used as a backing store.

bool canRead

true if reading from the buffer should be allowed; otherwise, false.

bool canWrite

true if writing to the buffer should be allowed; otherwise, false.

int index

Index inside the buffer in terms of element count (not size in bytes).

bool pinBuffer

True to keep the managed buffer and pin it, false will allocate unmanaged memory and make a copy of it. Default is true.

Returns
Type Description
DataStream
Type Parameters
Name Description
T