public static ReadOnlySpan <byte> AsBytes <T>(this ReadOnlySpan <T> source)
where T : struct
{
if (!SpanHelpers.IsReferenceFree <T>())
{
ThrowHelper.ThrowArgumentException_InvalidTypeWithPointersNotSupported(typeof(T));
}
int newLength = checked (source.Length * Unsafe.SizeOf <T>());
return(new ReadOnlySpan <byte>(Unsafe.As <Pinnable <byte> >(source.Pinnable), source.ByteOffset, newLength));
}