And doing the following:
public static byte[] Serialize<T>(T o) { ES3File f = new ES3File(false); f.Save<T>("data", o); return f.LoadRawBytes(); } public static T Deserialize<T>(byte[] data) { ES3File f = new ES3File(data, false); return f.Load<T>("data"); }And then I use it the following way:
byte[] data = Serialize(t1); TestClass t2 = Deserialize<TestClass>(data);The problem is that I get "KeyNotFoundException: Key "data" was not found in this ES3File" exception. I've checked - the "data" (byte array) is correct - the exact the same that came after the "serialize method".
Digging into ES3 code, I've noticed that the "cache" which contains the keys dictionary is inited only when syncWithFile is true.
So, am I doing something wrong? Or is there an error in the ES3 code?