MiniMessagePack decodes and encodes MessagePack binaries. Handy for parsing MessagePack from inside Unity3d. It is possible to easily replace the MiniJSON.
To install this, copy MiniMessagePack/MiniMessagePacker.cs to Assets folder in your project.
using MiniMessagePack;
// it means {"compact":true,"schema":0} in JSON
var msgpack = new byte[] {
0x82, 0xa7, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0xc3,
0xa6, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x00
};
var packer = new MiniMessagePacker ();
object unpacked_data = packer.Unpack (msgpack);
/*
unpacked_data = new Dictionary<string, object> {
{ "compact", true },
{ "schema", 0},
};
*/
using MiniMessagePack;
var unpacked_data = new Dictionary<string, object> {
{ "compact", true },
{ "schema", 0},
};
var packer = new MiniMessagePacker ();
byte[] msgpack = packer.Pack (unpacked_data);
// msgpack = new byte[] { 0x82, 0xa7, ...};