1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/mirrors-MessagePack-CSharp

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
UnsafeUnmanagedStructFormatter.md 1016
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
pCYSl5EDgo Отправлено 24.10.2020 07:57 d372c7a

Abstract

UnsafeUnmanagedStructFormatters (de)serialize the blittable value(s) directly. They are very performant but unstable against the endian.

You should be careful not to share the encoded byte[] among the different endian environments.

Supported types (T where T : unamanaged)

  • TUnsafeUnmanagedStructFormatter<T>
  • T[]UnsafeUnmanagedStructArrayFormatter<T>
  • Memory<T>UnsafeUnmanagedStructMemoryFormatter<T>
  • ReadOnlyMemory<T>UnsafeUnmanagedStructReadOnlyMemoryFormatter<T>
  • ReadOnlySequence<T>UnsafeUnmanagedStructReadOnlySequenceFormatter<T>

Usage

var resolver = MessagePack.Resolvers.CompositeResolver.Create(
    new[] { new UnsafeUnmanagedStructFormatter<Matrix4x4>(typeCode: 96) },
    new[] { MessagePack.Resolvers.StandardResolver.Instance });

The constructor takes 1 sbyte value. The sbyte value is the extension type code embedded in serialized byte sequence.

When will this feature become official?

  • Requests are needed.

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/mirrors-MessagePack-CSharp.git
git@api.gitlife.ru:oschina-mirror/mirrors-MessagePack-CSharp.git
oschina-mirror
mirrors-MessagePack-CSharp
mirrors-MessagePack-CSharp
master