Method Read
Read<T>(ReadOnlyExSpan<byte>)
Reads a structure of type T out of a read-only span of bytes (从字节的只读跨度中读取的 T 类型结构体).
public static T Read<T>(ReadOnlyExSpan<byte> source) where T : struct
Parameters
sourceReadOnlyExSpan<byte>The source span (源跨度).
Returns
- T
The structure retrieved from the read-only span (从只读跨度中读取的结构体).
Type Parameters
TThe element type (元素的类型).
Exceptions
- ArgumentException
T contains managed object references.
- ArgumentOutOfRangeException
source is smaller than T's length in bytes.