C# BitConverter GetBytes(Single)
Description
BitConverter GetBytes(Single)
returns the specified
single-precision floating point value as an array of bytes.
Syntax
BitConverter.GetBytes(Single)
has the following syntax.
public static byte[] GetBytes(
float value
)
Parameters
BitConverter.GetBytes(Single)
has the following parameters.
value
- The number to convert.
Returns
BitConverter.GetBytes(Single)
method returns
Example
The following code example converts the bit patterns of Single values to Byte arrays with the GetBytes method.
using System;/*from w w w . ja va 2 s .co m*/
class GetBytesUInt64Demo
{
public static void Main( )
{
byte[ ] byteArray = BitConverter.GetBytes( (Single)1000 );
Console.WriteLine(BitConverter.ToString( byteArray ) );
}
}
The code above generates the following result.