Struct ReadOnlyMemory<T>
- Namespace
- System
- Assembly
- System.Memory.dll
public readonly struct ReadOnlyMemory<T>
Type Parameters
T
- Inherited Members
-
Constructors
ReadOnlyMemory(T[])
public ReadOnlyMemory(T[] array)
Parameters
array T[]
ReadOnlyMemory(T[], int, int)
public ReadOnlyMemory(T[] array, int start, int length)
Parameters
array T[]
start int
length int
Properties
Empty
public static ReadOnlyMemory<T> Empty { get; }
Property Value
- ReadOnlyMemory<T>
IsEmpty
public bool IsEmpty { get; }
Property Value
- bool
Length
public int Length { get; }
Property Value
- int
Span
public ReadOnlySpan<T> Span { get; }
Property Value
- ReadOnlySpan<T>
Methods
CopyTo(Memory<T>)
public void CopyTo(Memory<T> destination)
Parameters
destination Memory<T>
Equals(ReadOnlyMemory<T>)
public bool Equals(ReadOnlyMemory<T> other)
Parameters
other ReadOnlyMemory<T>
Returns
- bool
Pin()
public MemoryHandle Pin()
Returns
- MemoryHandle
Slice(int)
public ReadOnlyMemory<T> Slice(int start)
Parameters
start int
Returns
- ReadOnlyMemory<T>
Slice(int, int)
public ReadOnlyMemory<T> Slice(int start, int length)
Parameters
start int
length int
Returns
- ReadOnlyMemory<T>
ToArray()
Returns
- T[]
ToString()
public override string ToString()
Returns
- string
TryCopyTo(Memory<T>)
public bool TryCopyTo(Memory<T> destination)
Parameters
destination Memory<T>
Returns
- bool
Operators
implicit operator ReadOnlyMemory<T>(ArraySegment<T>)
public static implicit operator ReadOnlyMemory<T>(ArraySegment<T> segment)
Parameters
segment ArraySegment<T>
Returns
- ReadOnlyMemory<T>
implicit operator ReadOnlyMemory<T>(T[])
public static implicit operator ReadOnlyMemory<T>(T[] array)
Parameters
array T[]
Returns
- ReadOnlyMemory<T>