使用BitConverter对int与byte[]类型进行互相转换

使用BitConverter对int与byte[]类型进行互相转换
int转换到byte[]
int iCount = 45;
byte[] byInputData =  BitConverter.GetBytes(iCount);
byte[]转换回int
int iCount = BitConverter.ToInt32(byInputData, 0);

原文地址:https://www.cnblogs.com/KingOfSoft/p/707207.html