1、浮点数转4字节数组
/// <summary>
/// 浮点数转4字节数组
/// </summary>
/// <param name="f"></param>
/// <returns></returns>
public static byte[] FloatTo4Byte(float f)
{
byte[] b = BitConverter.GetBytes(f);
Array.Reverse(b);
return b;
}
2、32位整数转字节数组
/// <summary>
/// 32位整数转字节数组
/// </summary>
/// <param name="i"></param>
/// <returns></returns>
public static byte[] Int32To2Byte(Int32 i)