wynblogscc

byte数组转换为int

byte[] bytes = {0xff, 0xff};

int num = BitConverter.ToInt32(bytes, 0);  // 0为字节数组开始转换的起始位置下标

 

int 转换为 byte数组

int num = 3;

byte[] bytes = BitConverter.GetBytes(num);  

 

分类:

技术点:

相关文章: