In .NET Framework, BitConverter Class helps us to convert base Datatypes to an array of bytes and vice-versa.
GetBytes Method that takes an integer, double or other base type value is static overloaded method of BitConverter class which converts that to an array of bytes. To reverse this conversion BitConverter also has other static methods. For Example:
Code snippet below converts different integer values to a byte array and vice-vers