Following C# code snippet can be used to convert the interger value into byte array:
using System;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//Declare an integer variable and assign an integer value
Int32 intVar = 245;
Console.WriteLine("Integer Value: " + intVar.ToString());
//Convert integer value to byte array and display it
byte[] bytes = BitConverter.GetBytes(intVar);
Console.WriteLine("Byte Array Value: " + BitConverter.ToString(bytes));
//Convert and display the byte array back to integer
double dblValue = BitConverter.ToInt32(bytes,0);
Console.WriteLine("Byte array back to Integer: " + dblValue.ToString());
Console.ReadLine();
}
}
}