62,614
社区成员
发帖
与我相关
我的任务
分享
byte[] byteArray = { 0x00, 0x00, 0x0e, 0x89, 0x00, 0x00, 0x27, 0xa7 };
// write bigid
byte[] intByte = System.BitConverter.GetBytes(bigid);
byteArray[0] = intByte[3];
byteArray[1] = intByte[2];
byteArray[2] = intByte[1];
byteArray[3] = intByte[0];
// write smid
intByte = System.BitConverter.GetBytes(smid);
byteArray[4] = intByte[3];
byteArray[5] = intByte[2];
byteArray[6] = intByte[1];
byteArray[7] = intByte[0];
/////////////////////////////////////////////////
Stream dataStream =...;
BinaryReader BR = new BinaryReader(dataStream);
// skip 3 byte
BR.ReadByte();
BR.ReadByte();
BR.ReadByte();
if (0 == BR.ReadInt32())
{
byte[] tmpByte = new byte[4];
tmpByte[3] = BR.ReadByte();
tmpByte[2] = BR.ReadByte();
tmpByte[1] = BR.ReadByte();
tmpByte[0] = BR.ReadByte();
int tiia = BitConverter.ToInt32(tmpByte, 0);
out double tA = (double)tiia / 1000000D;
}
int s=0;
for(int i=0;i<tmpByte.length;i++){
s<<=8;
s|=(tmpByte[i] & 0x000000ff);
}
return s;