MemoryMarshal

MemoryMarshal class

Provides memory marshalling implementation. For compatibility with translated code only, as no managed code is supported on C++ side. This is a static type with no instance services. You should never create instances of it by any means.

class MemoryMarshal

Methods

MethodDescription
static Span<uint8_t> AsBytes(const Span<T>&)Casts a Span of one primitive type T to Span of bytes.
static Memory<T> AsMemory(const ReadOnlyMemory<T>&)Casts a ReadOnlyMemory to mutable Memory.
static Span<TTo> Cast(const Span<TFrom>&)Casts a Span of one primitive type TFrom to another primitive type TTo.
static T& GetReference(const Span<T>&)Gets a reference to the first element of the specified span.
static T& GetReference(const ReadOnlySpan<T>&)Gets a reference to the first element of the specified read-only span.

See Also