How to convert byte array to any type
Primitive types are easy because they have a defined representation as a byte array. Other objects are not because they may contain things that cannot be persisted, like file handles, references to other objects, etc. You can try persisting an object to a byte array using BinaryFormatter: public byte[] ToByteArray<T>(T obj) { if(obj == null) … Read more