UnsafeUnmanagedStructFormatter
s (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)
T
→ UnsafeUnmanagedStructFormatter<T>
T[]
→ UnsafeUnmanagedStructArrayFormatter<T>
Memory<T>
→ UnsafeUnmanagedStructMemoryFormatter<T>
ReadOnlyMemory<T>
→ UnsafeUnmanagedStructReadOnlyMemoryFormatter<T>
ReadOnlySequence<T>
→ UnsafeUnmanagedStructReadOnlySequenceFormatter<T>
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.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )