System.SpanTests.SpanTests.AsBytesUIntToByte C# (CSharp) Method

AsBytesUIntToByte() private method

private AsBytesUIntToByte ( ) : void
return void
        public static void AsBytesUIntToByte()
        {
            uint[] a = { 0x44332211, 0x88776655 };
            Span<uint> span = new Span<uint>(a);
            Span<byte> asBytes = span.AsBytes<uint>();

            Assert.True(Unsafe.AreSame<byte>(ref Unsafe.As<uint, byte>(ref span.DangerousGetPinnableReference()), ref asBytes.DangerousGetPinnableReference()));
            asBytes.Validate<byte>(0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88);
        }