byte[] bytes = new byte[256];
MemoryStream ms = new MemoryStream( bytes );
StreamReader sr = new StreamReader(ms);
string s = sr.ReadToEnd();
///
用Convert类体供的方法,转成你需要的类型
a = (int)bytes[0];
b = (int)bytes[1];
c = (int)bytes[2];
d = (int)bytes[3];
int r = (int)(a*0x1000+b*0x100+c*0x10+d);
这四个字节分别是存放Int数组不同位的值,我们拿10进制数值做个比方,例如一个数组:
int[] a = int[4]
{ 1,2,3,4 };
//如果要把这四个整数组合成一个整数,那么:
int result = a[3]*1000+a[2]*100+a[1]*10+a[0];
//这样 result 就等于1234