From a37d0e9c9203d680bf63698cf9d47447a57b5684 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 6 Feb 2018 19:46:56 +0200 Subject: Diagnostics Data Playing Works! --- .../Tango.Serialization/BinaryDataSerializer.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.Serialization') diff --git a/Software/Visual_Studio/Tango.Serialization/BinaryDataSerializer.cs b/Software/Visual_Studio/Tango.Serialization/BinaryDataSerializer.cs index 26dcdad83..71efe9318 100644 --- a/Software/Visual_Studio/Tango.Serialization/BinaryDataSerializer.cs +++ b/Software/Visual_Studio/Tango.Serialization/BinaryDataSerializer.cs @@ -41,6 +41,21 @@ namespace Tango.Serialization } } + /// + /// Deserialize object from bytes. + /// + /// Type of object to deserialize. + /// The full path of the data file. + /// The resulting object. + public T DeserializeFromBytes(byte[] bytes) + { + using (MemoryStream ms = new MemoryStream(bytes)) + { + ms.Position = 0; + return DeserializeFromStream(ms); + } + } + /// /// Serialize object to stream. /// @@ -54,7 +69,7 @@ namespace Tango.Serialization } /// - /// Serialize object to stream. + /// Serialize object to byte array. /// /// Type of specified object. /// The specified object. -- cgit v1.3.1