Mega Code Archive

 
Categories / C# / Development Class
 

Convert specified 64-bit unsigned integer value to an array of bytes

using System; class GetBytesUInt64Demo {     const string formatter = "{0,22}{1,30}";     public static void GetBytesUInt64( ulong argument )     {         byte[ ] byteArray = BitConverter.GetBytes( argument );         Console.WriteLine( formatter, argument, BitConverter.ToString( byteArray ) );     }     public static void Main( )     {         GetBytesUInt64( 0xFFFFFF );     } }