Closed tobe83 closed 2 years ago
What protobuf NuGet package are you using? I think I remember seeing a fork that implemented a binary serializer but don't have time to check right now.
this one here: https://www.nuget.org/packages/protobuf-net/
I tweaked your implementation a bit and got it working:
public object Deserialize(byte[] data, Type type)
{
using (var memoryStream = new MemoryStream())
{
memoryStream.Write(data, 0, data.Length);
memoryStream.Position = 0;
return Serializer.Deserialize(type, memoryStream);
}
}
You need to set position back to 0 in the MemoryStream
for the deserializer to read the data.
Hello, nice work with the PipeMethodCalls.
I want to use a binary serializer and so I made my own implementation with ProtoBuf:
But this doesn't work. What binary serializer do you recommend?
Cheers, Tobias