Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]
Перейти к файлу
neuecc 7109050e97 0.4.0 ready 2017-03-01 13:13:22 +09:00
nuget 0.4.0 ready 2017-03-01 13:13:22 +09:00
sandbox working analyzer 2017-02-28 23:48:04 +09:00
src 0.4.0 ready 2017-03-01 13:13:22 +09:00
tests 0.2.0 2017-02-28 09:25:08 +09:00
.gitattributes Update .gitattributes 2017-02-13 09:59:43 +09:00
.gitignore works perfectly 2017-02-28 22:46:44 +09:00
LICENSE Create LICENSE 2017-02-13 10:00:25 +09:00
MessagePack.sln 0.4.0 ready 2017-03-01 13:13:22 +09:00
README.md works perfectly 2017-02-28 22:46:44 +09:00
build_libz.bat works perfectly 2017-02-28 22:46:44 +09:00
libz.exe nuge 2017-02-28 22:46:36 +09:00
make_unity_symlink.bat works perfectly 2017-02-28 22:46:44 +09:00

README.md

MessagePack for C#(.NET, .NET Core, Unity)

Brainchild of ZeroFormatter, fastest MessagePack serializer on .NET.

Work in progress, stay tuned.

image

Extremely fast, x10~20 faster than MsgPack-Cli.

Install

Beta is relased(please enable include pre-release package).

Standard library for .NET, .NET Core

Install-Package MessagePack -Pre

for Unity, download from releases page(not yet).

Extension Packages(info is see detail section).

Install-Package MessagePack.ImmutableCollection -Pre
Install-Package MessagePack.ReactiveProperty -Pre
Install-Package MessagePack.Unity -Pre

Quick Start

Define class and mark as [MessagePackObject] and public properties mark [Key], call MessagePackSerializer.Serialize<T>/Deserialize<T>.

// mark MessagePackObjectAttribute
[MessagePackObject]
public class MyClass
{
    // Key is serialization index, it is important for versioning.
    [Key(0)]
    public int Age { get; set; }

    [Key(1)]
    public string FirstName { get; set; }

    [Key(2)]
    public string LastName { get; set; }

    // If does not mark KeyAttribute, the property don't serialize/deserialize it.
    public string FullName { get { return FirstName + LastName; } }
}

class Program
{
    static void Main(string[] args)
    {
        var mc = new MyClass
        {
            Age = 99,
            FirstName = "hoge",
            LastName = "huga",
        };

		// call Serialize/Deserialize, that's all.
        var bytes = MessagePackSerializer.Serialize(mc);
        var mc2 = MessagePackSerializer.Deserialize<MyClass>(bytes);
    }
}

Union

TODO:

Extensions

TODO:

Build

Open MessagePack.sln on Visual Studio 2017.

Unity Project is using symbolic link. At first, run make_unity_symlink.bat so linked under Unity project. You can open src\MessagePack.UnityClient on Unity Editor.

CodeGenerator(mpc.exe) is merged single exe to many dll by LibZ. run build_libz.bat, you can combine it.