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