using System;
namespace ConsoleApp1
{
class Program
static void Main(string[] args)
byte[] bytes = new byte[] { 64, 0, 0, 0 };
// If the system architecture is little-endian (that is, little end first),
// reverse the byte array.
if (BitConverter.IsLittleEndian)
Array.Reverse(bytes);
int i = BitConverter.ToInt32(bytes, 0);
Console.WriteLine("int: {0}", i); // output: int: 1073741824
}