Files
UVtools/PrusaSL1Reader/ObjectExtensions.cs
T
Tiago Conceição db04afa97e Pre0.2 commit
2020-04-11 21:16:49 +01:00

25 lines
748 B
C#

/*
* GNU AFFERO GENERAL PUBLIC LICENSE
* Version 3, 19 November 2007
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
namespace PrusaSL1Reader
{
public static class ObjectExtensions
{
public static object DeserializeFromBytes(byte[] bytes)
{
var formatter = new BinaryFormatter();
using (var stream = new MemoryStream(bytes))
{
return formatter.Deserialize(stream);
}
}
}
}