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