fork from 1.3
This commit is contained in:
15
FreeSR.Dispatch/Util/ProtobufUtil.cs
Normal file
15
FreeSR.Dispatch/Util/ProtobufUtil.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace FreeSR.Dispatch.Util
|
||||
{
|
||||
using ProtoBuf;
|
||||
|
||||
internal static class ProtobufUtil
|
||||
{
|
||||
public static byte[] Serialize<T>(T obj) where T : class
|
||||
{
|
||||
var stream = new MemoryStream();
|
||||
Serializer.Serialize(stream, obj);
|
||||
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user