This is the way to test taken from msdn:
http://msdn.microsoft.com/en-us/library/bb384066.aspx[
^]
byte[] bytes = { 0, 0, 0, 25 };
int i = BitConverter.ToInt32(bytes, 0);
Console.WriteLine("int: {0}", i);
If this prints 25 then your computer is big-endian - you send testBytes [3] first.
If it does not print 25 then send testBytes [0] first.
There is however a test for endian_ness BitConverter.IsLittleEndian. So you can write:
byte[] bytes = { 0, 0, 0, 25 };
if (BitConverter.IsLittleEndian)
Array.Reverse(bytes);
int i = BitConverter.ToInt32(bytes, 0);
Console.WriteLine("int: {0}", i);
You should also look at BitConverter.GetBytes(Int32) for converting Int32 to byte array.
http://msdn.microsoft.com/en-us/library/de8fssa4(v=vs.110).aspx[
^]