C# 解析雷达bin文件数据
FileStream fs = null;
BinaryReader reader = null;
byte[] data;
var encoding = Encoding.Default;
int[] sd;
fs = new FileStream(binFile, FileMode.Open, FileAccess.Read);
reader = new BinaryReader(fs);
data = reader.ReadBytes((int)fs.Length);
reader.Close();
fs.Close();
//string类型
encoding.GetString(data, 0, 12).TrimEnd('\0');
//uint 类型
(uint)(data[66] | data[67] << 8);
//int类型
(int)(data[84] | data[85] << 8 | data[86] << 16 | data[87] << 24);
//float类型
BitConverter.ToSingle(NewByte(data, 88, 4), 0);
//数据段解析
sd[i] = (((int)data[i +1024]) - 66) / 2;