public static object Reserialize(this IBinaryLayerHandler handler, object input) { object output; using (var ms = new MemoryStream()) { handler.Serialize(new BinaryDataWriter(ms), input); ms.Position = 0; output = handler.Deserialize(new BinaryDataReader(ms)); Assert.That(ms.Position, Is.EqualTo(ms.Length), "Stream should be read till the end"); } return(output); }
public object Load(IniKeyCollection iniData, LayerHandlerContext context) { using (var reader = new BinaryDataReader(context.LoadExternalFile(DataFileKey))) return(binaryHandler.Deserialize(reader)); }