c# get binary array from int

C#
byte[] bytes = BitConverter.GetBytes(i);
Source

Also in C#: