.net - How to use MessagePack in C#? -


i read msgpack-cli quick start documentation.

i got c# (cli) nuget package (v0.3).

none of classes (eg boxingpacker, compiledpacker or objectpacker) mentioned in official documentation exist in nuget package (!!). i'm presuming documentation has been orphaned.

so have examples how serialize/deserialize to/from messagepack within c#? i'm trying object , interested in binary nature of serializer.

to future readers: i'd go avro or protocol buffers or thrift on messagepack based on these results ...

for sake of specific question, key portions are:

public byte[] serialize<t>(t thisobj) {     var serializer = messagepackserializer.create<t>();      using (var bytestream = new memorystream())     {         serializer.pack(bytestream, thisobj);         return bytestream.toarray();     } }  public t deserialize<t>(byte[] bytes) {     var serializer = messagepackserializer.create<t>();     using (var bytestream = new memorystream(bytes))     {         return serializer.unpack(bytestream);     } } 

the entire r&d type project, results @ https://github.com/sidshetye/serializerscompare , specific function calls here.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -