public byte[] LongToByte(long lg) {
byte[] b = new byte[8];
int c = 0;
for (int i = 0; i <8 ; i++) {
b[i] = (byte)(lg >> c);
c = c + 8;
}
return b;
}
public long ByteToLong(byte[] b)
{
long lg = 0;
int c = 0;
for (int i = 0; i < b.Length; i++)
{
lg = lg+(b[i] << c);
c = c + 8;
}
return lg;
}
长整型转换成8字节数组
最新推荐文章于 2022-04-09 03:24:19 发布