Converts the bit patterns of UInt32 values to Byte arrays with the GetBytes method. : Bits « Data Type « C# / CSharp Tutorial






using System;

class GetBytesUInt32Demo
{
    const string formatter = "{0,16}{1,20}";

    public static void GetBytesUInt32( uint argument )
    {
        byte[ ] byteArray = BitConverter.GetBytes( argument );
        Console.WriteLine( formatter, argument,BitConverter.ToString( byteArray ) );
    }

    public static void Main( )
    {
        GetBytesUInt32( 15 );
    }
}








2.42.Bits
2.42.1.Bitwise Operators
2.42.2.Display the bits within a byte.
2.42.3.Use enum value to mark BitArrays
2.42.4.Converts the bit patterns of UInt32 values to Byte arrays with the GetBytes method.