C# BitConverter GetBytes(Int64)
Description
BitConverter GetBytes(Int64)
returns the specified
64-bit signed integer value as an array of bytes.
Syntax
BitConverter.GetBytes(Int64)
has the following syntax.
public static byte[] GetBytes(
long value
)
Parameters
BitConverter.GetBytes(Int64)
has the following parameters.
value
- The number to convert.
Returns
BitConverter.GetBytes(Int64)
method returns
Example
The following code example converts the bit patterns of Int64 values to Byte arrays with the GetBytes method.
using System;// w w w . j a va 2s. c o m
class GetBytesUInt64Demo
{
public static void Main( )
{
byte[ ] byteArray = BitConverter.GetBytes( (Int64)1000 );
Console.WriteLine(BitConverter.ToString( byteArray ) );
}
}
The code above generates the following result.