Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Greentube.Serialization.MessagePack.csproj
MessagePackOptions.cs
MessagePackSerializer.cs
README.md

README.md

Greentube.Serialization.MessagePack NuGet

Implementation of ISerializer with MessagePack-CSharp.

This library targets netstandard2.0 since that's the version MessagePack depends on.

No other dependencies besides Greentube.Serialization and MessagePack are introduced via this package.

var messagePack = new MessagePackSerializer(new MessagePackOptions());

Options

FormatterResolver

MessagePack library exposes a IFormatterResolver to allow formatting extensibility. This is accessed via the MessagePackOptions like:

var messagePack = new MessagePackSerializer(
    new MessagePackOptions
    {
        FormatterResolver = null // formatter
    });

By leaving the formatter null (default), the underlying package uses the default formatter.

One of such formatters which is fairly useful is the ContractlessStandardResolver. It can be defined like:

var messagePack = new MessagePackSerializer(
    new MessagePackOptions
    {
        FormatterResolver = global::MessagePack.Resolvers.ContractlessStandardResolver.Instance
    });

LZ4 compression

It's also possible to use LZ4 compression by defining:

var MessagePack = new MessagePackSerializer(
    new MessagePackOptions
    {
        UseLz4Compression = true
    });
You can’t perform that action at this time.