public static object Deserialize(this byte[] data, Type objectType) { object result; using (var reader = SerializationReader.CreateReader(data)) { result = reader.ReadObject(objectType, ObjectTypeCode.Object, false); } return(result); }
public static T Deserialize <T>(this byte[] data) where T : class { T result; using (var reader = SerializationReader.CreateReader(data)) { result = (T)reader.ReadObject(typeof(T), ObjectTypeCode.Object, false); } return(result); }
public static SerializationReader CreateReader(SerializationInfo info) { byte[] buffer = (byte[])info.GetValue("X", typeof(byte[])); return(SerializationReader.CreateReader(buffer)); }