mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-12 03:22:32 +02:00
25 lines
748 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|