public static CastArray<TFrom, TTo> Cast<TFrom, TTo>(
this ArraySegment<TFrom> arraySegment
)
where TFrom : struct, new()
where TTo : struct, new()
<ExtensionAttribute>
Public Shared Function Cast(Of TFrom As {Structure, New}, TTo As {Structure, New}) (
arraySegment As ArraySegment(Of TFrom)
) As CastArray(Of TFrom, TTo)
public:
[ExtensionAttribute]
generic<typename TFrom, typename TTo>
where TFrom : value class, gcnew()
where TTo : value class, gcnew()
static CastArray<TFrom, TTo> Cast(
ArraySegment<TFrom> arraySegment
)
[<ExtensionAttribute>]
static member Cast :
arraySegment : ArraySegment<'TFrom> -> CastArray<'TFrom, 'TTo> when 'TFrom : struct, new() when 'TTo : struct, new()
If the size of TTo cannot be divided by the size of TFrom, then the cast result may not cover the whole original arraySegment to prevent exceeding beyond the available buffer.