hwo to convert list of custom class to a byte
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
byte[] bytes = null;
BinaryFormatter bf = new BinaryFormatter();
using (MemoryStream ms = new MemoryStream())
{
//categoryList is where you put the list that you want to convert
bf.Serialize(ms, categoryList);
bytes = ms.ToArray();
}