C# BitConverter GetBytes(UInt64)
Description
BitConverter GetBytes(UInt64)
returns the specified
64-bit unsigned integer value as an array of bytes.
Syntax
BitConverter.GetBytes(UInt64)
has the following syntax.
[CLSCompliantAttribute(false)]
public static byte[] GetBytes(
ulong value
)
Parameters
BitConverter.GetBytes(UInt64)
has the following parameters.
value
- The number to convert.
Returns
BitConverter.GetBytes(UInt64)
method returns
Example
The following code example converts the bit patterns of UInt64 values to Byte arrays with the GetBytes method.
using System;/*from www. j a v a 2s. com*/
class GetBytesUInt64Demo
{
public static void Main( )
{
byte[ ] byteArray = BitConverter.GetBytes( 1000000000 );
Console.WriteLine(BitConverter.ToString( byteArray ) );
}
}
The code above generates the following result.