支持所有非托管类型,包括 bool,其中 bool 会按位处理。
public static ReadOnlyMemory<T> ToValues<T>(
ReadOnlySpan<byte> span,
EndianType endianType
)
where T : struct, new()
Public Shared Function ToValues(Of T As {Structure, New}) (
span As ReadOnlySpan(Of Byte),
endianType As EndianType
) As ReadOnlyMemory(Of T)static member ToValues :
span : ReadOnlySpan<byte> *
endianType : EndianType -> ReadOnlyMemory<'T> when 'T : struct, new()