CINXE.COM

GitHub - MessagePack-CSharp/MessagePack-CSharp: Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]

<!DOCTYPE html> <html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system" data-a11y-link-underlines="true" > <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-3e154969b9f9.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-9c5b7a476542.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-afda8eb0fb33.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-2494e44ccdc5.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-56fff47acadc.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-71cd4cc132ec.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-fd5499848985.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-31d17ba3e139.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-68d6b2c79663.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-primitives-4cf0d59ab51a.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-af846850481e.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-8b10f05a77e6.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-2f6e722088eb.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repository-9c77ed90200e.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-a0610fd00b47.css" /> <script type="application/json" id="client-env">{"locale":"en","featureFlags":["copilot_new_references_ui","copilot_beta_features_opt_in","copilot_chat_static_thread_suggestions","copilot_conversational_ux_history_refs","copilot_implicit_context","copilot_smell_icebreaker_ux","experimentation_azure_variant_endpoint","failbot_handle_non_errors","geojson_azure_maps","ghost_pilot_confidence_truncation_25","ghost_pilot_confidence_truncation_40","hovercard_accessibility","issues_react_new_timeline","issues_react_avatar_refactor","issues_react_remove_placeholders","issues_react_blur_item_picker_on_close","marketing_pages_search_explore_provider","react_keyboard_shortcuts_dialog","remove_child_patch","sample_network_conn_type","site_metered_billing_update","issues_react_first_time_contribution_banner","ui_commands_respect_modals","lifecycle_label_name_updates"]}</script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-e461d4ea0fb4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_dompurify_dist_purify_js-b73fdff77a4e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover_js-aff936e590ed.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_arianotify-polyfill_ariaNotify-polyfill_js-node_modules_github_mi-247092-740e4ddd559d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_failbot_failbot_ts-93b6a0551aa9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-cd35650c2e9c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_index_mjs-4aa4b0e95669.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-f690fd9ae3d5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-6d3967acd51c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_combobox-nav_dist_index_js-node_modules_github_g-emoji-element_di-6ce195-53781cbc550f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-6afc16-3cdfa69a0406.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_text-expander-element_dist_index_js-f5498b8d4e5d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-b5f1d7-492b5042c841.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-1f651a-1e3d784c897c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-7671f1-dc6cac136d88.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-71486356f507.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-e3ab8405ef80.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_braintree_browser-detection_dist_browser-detection_js-node_modules_githu-bb80ec-634de60bacfa.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-ce7225a304c5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_hydro-analytics-client_dist_analytics-client_js-node_modules_gith-f3aee1-e6893db9c19e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_morphdom_dist_morphdom-e-7c534c-f8a5485c982a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js-858e043fcf76.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-893f9f-6cf3320416b8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_scroll-anchoring_dist_scroll-anchoring_esm_js-node_modules_stacktrace-pa-a71630-6f3c4f0189d8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-0e07cc183eed.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_quote-selection_dist_index_js-node_modules_github_session-resume_-0b5e12-889cec8cf448.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_updatable-content_updatable-content_ts-eae9df0dd562.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_task-list_ts-app_assets_modules_github_sso_ts-ui_packages-900dde-18d1c91a7872.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-7cbef09a422c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-d0d0a6-0e9fa537dc4f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-c89801ebbe15.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-a6e4c4c86bfa.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-f6223d90c7ba.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-3366f6b6298e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_template-parts_lib_index_js-96453a51f920.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-b0a862-4d8589138d1e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-0e9dbe-d2bcedf65682.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-043af64042a1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-4158520ad4d7.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_decorators_js-node_modules_delegated-events_di-cc9bcb-ea42a360c5ae.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_filter--35675b-aff280068839.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-ce9ff2a57e1f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_catalyst_lib_inde-dbbea9-9b97703a4e6a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-13971a40799a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/primer-react-765944243383.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-core-cd0a67881543.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-lib-7b7b5264f6c1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/octicons-react-45c3a19dd792.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_tanstack_query-core_build_modern_queryClient_js-e40bb86d3e93.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_emotion_is-prop-valid_dist_emotion-is-prop-valid_esm_js-node_modules_emo-37e3d5-31653d7f2342.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-e7dcdd-285fc29e9fa5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover-fn_js-4896ddd4b7bb.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-subscriptions-menu-3eda30673b32.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.9fa170e9435ed4b922b9.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/notifications-subscriptions-menu.1bcff9205c241e99cff2.module.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/primer-react-765944243383.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-core-cd0a67881543.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-lib-7b7b5264f6c1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/octicons-react-45c3a19dd792.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_tanstack_query-core_build_modern_queryClient_js-e40bb86d3e93.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_emotion_is-prop-valid_dist_emotion-is-prop-valid_esm_js-node_modules_emo-37e3d5-31653d7f2342.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-e7dcdd-285fc29e9fa5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover-fn_js-4896ddd4b7bb.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-subscriptions-menu-3eda30673b32.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.9fa170e9435ed4b922b9.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/notifications-subscriptions-menu.1bcff9205c241e99cff2.module.css" /> <title>GitHub - MessagePack-CSharp/MessagePack-CSharp: Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]</title> <meta name="route-pattern" content="/:user_id/:repository" data-turbo-transient> <meta name="route-controller" content="files" data-turbo-transient> <meta name="route-action" content="disambiguate" data-turbo-transient> <meta name="current-catalog-service-hash" content="f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb"> <meta name="request-id" content="B7CA:21BDAF:1740412:1A25417:6747D746" data-pjax-transient="true"/><meta name="html-safe-nonce" content="ccf08dab37267c7d1edb843af4aea06482e1d7b4aa5f54692657d5e1762d09be" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0NBOjIxQkRBRjoxNzQwNDEyOjFBMjU0MTc6Njc0N0Q3NDYiLCJ2aXNpdG9yX2lkIjoiNDI0OTQwNDgzNzI1MjgxNDY2MiIsInJlZ2lvbl9lZGdlIjoic291dGhlYXN0YXNpYSIsInJlZ2lvbl9yZW5kZXIiOiJzb3V0aGVhc3Rhc2lhIn0=" data-pjax-transient="true"/><meta name="visitor-hmac" content="8ae2e5a98239840d9cb52b3a4dffb663a84207d0a770ca623c0fbf95710a3627" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:81770291" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,copilot" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <link rel="assets" href="https://github.githubassets.com/"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/&lt;user-name&gt;/&lt;repo-name&gt;" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] - MessagePack-CSharp/MessagePack-CSharp"> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://github.com/MessagePack-CSharp/MessagePack-CSharp" /> <meta name="twitter:image" content="https://opengraph.githubassets.com/497366cd9b027811e30bc3aab8898a35e16e25626f7122b1298f839000073c20/MessagePack-CSharp/MessagePack-CSharp" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="GitHub - MessagePack-CSharp/MessagePack-CSharp: Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]" /><meta name="twitter:description" content="Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] - MessagePack-CSharp/MessagePack-CSharp" /> <meta property="og:image" content="https://opengraph.githubassets.com/497366cd9b027811e30bc3aab8898a35e16e25626f7122b1298f839000073c20/MessagePack-CSharp/MessagePack-CSharp" /><meta property="og:image:alt" content="Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] - MessagePack-CSharp/MessagePack-CSharp" /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="GitHub - MessagePack-CSharp/MessagePack-CSharp: Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]" /><meta property="og:url" content="https://github.com/MessagePack-CSharp/MessagePack-CSharp" /><meta property="og:description" content="Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] - MessagePack-CSharp/MessagePack-CSharp" /> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta http-equiv="x-pjax-version" content="3535d6c3831fa0b1cc34486ad559fb7a24af10943d5cfdeb66b7614b42ffdc0c" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="ace39c3b6632770952207593607e6e0be0db363435a8b877b1f96abe6430f345" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="3adbaefc258174e49a9472f62ba4ed262e7c0112f9e7266a3e927bd7b898716f" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="f7329e9a58dfc2da1a112d60e9ac511545e76405362d6e340cc721513180d7ca" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/MessagePack-CSharp/MessagePack-CSharp git https://github.com/MessagePack-CSharp/MessagePack-CSharp.git"> <meta name="octolytics-dimension-user_id" content="138041803" /><meta name="octolytics-dimension-user_login" content="MessagePack-CSharp" /><meta name="octolytics-dimension-repository_id" content="81770291" /><meta name="octolytics-dimension-repository_nwo" content="MessagePack-CSharp/MessagePack-CSharp" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="81770291" /><meta name="octolytics-dimension-repository_network_root_nwo" content="MessagePack-CSharp/MessagePack-CSharp" /> <link rel="canonical" href="https://github.com/MessagePack-CSharp/MessagePack-CSharp" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <link rel="mask-icon" href="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg" data-base-href="https://github.githubassets.com/favicons/favicon"> <meta name="theme-color" content="#1e2327"> <meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative header-wrapper js-header-wrapper "> <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a> <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full"> <span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span> </span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/keyboard-shortcuts-dialog-78b8b9792a5f.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.9fa170e9435ed4b922b9.module.css" /> <react-partial partial-name="keyboard-shortcuts-dialog" data-ssr="false" data-attempted-ssr="false" > <script type="application/json" data-target="react-partial.embeddedData">{"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}</script> <div data-target="react-partial.reactRoot"></div> </react-partial> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-cf3dd69d89eb.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-8fa3b694f335.js"></script> <header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark> <h2 class="sr-only">Navigation Menu</h2> <button type="button" class="HeaderMktg-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span class="d-none">Toggle navigation</span> </button> <div class="d-flex flex-column flex-lg-row flex-items-center px-3 px-md-4 px-lg-5 height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <div class="flex-1"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target js-nav-padding-recalculate js-header-menu-toggle Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span class="Button-content"> <span class="Button-label"><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span> </button> </div> <a class="mr-lg-3 color-fg-inherit flex-order-2 js-prevent-focus-on-mobile-nav" href="/" aria-label="Homepage" data-analytics-event="{&quot;category&quot;:&quot;Marketing nav&quot;,&quot;action&quot;:&quot;click to go to homepage&quot;,&quot;label&quot;:&quot;ref_page:Marketing;ref_cta:Logomark;ref_loc:Header&quot;}"> <svg height="32" aria-hidden="true" viewBox="0 0 24 24" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12.5.75C6.146.75 1 5.896 1 12.25c0 5.089 3.292 9.387 7.863 10.91.575.101.79-.244.79-.546 0-.273-.014-1.178-.014-2.142-2.889.532-3.636-.704-3.866-1.35-.13-.331-.69-1.352-1.18-1.625-.402-.216-.977-.748-.014-.762.906-.014 1.553.834 1.769 1.179 1.035 1.74 2.688 1.25 3.349.948.1-.747.402-1.25.733-1.538-2.559-.287-5.232-1.279-5.232-5.678 0-1.25.445-2.285 1.178-3.09-.115-.288-.517-1.467.115-3.048 0 0 .963-.302 3.163 1.179.92-.259 1.897-.388 2.875-.388.977 0 1.955.13 2.875.388 2.2-1.495 3.162-1.179 3.162-1.179.633 1.581.23 2.76.115 3.048.733.805 1.179 1.825 1.179 3.09 0 4.413-2.688 5.39-5.247 5.678.417.36.776 1.05.776 2.128 0 1.538-.014 2.774-.014 3.162 0 .302.216.662.79.547C20.709 21.637 24 17.324 24 12.25 24 5.896 18.854.75 12.5.75Z"></path> </svg> </a> <div class="flex-1 flex-order-2 text-right"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2FMessagePack-CSharp%2FMessagePack-CSharp" class="HeaderMenu-link HeaderMenu-button d-inline-flex d-lg-none flex-order-1 f5 no-underline border color-border-default rounded-2 px-2 py-1 color-fg-inherit js-prevent-focus-on-mobile-nav" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/MessagePack-CSharp/MessagePack-CSharp&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="5a0a18e6ccc25c196c4ef3193a3410b17ab6ae92051703be6c4a58b21d54a513" data-analytics-event="{&quot;category&quot;:&quot;Marketing nav&quot;,&quot;action&quot;:&quot;click to Sign in&quot;,&quot;label&quot;:&quot;ref_page:Marketing;ref_cta:Sign in;ref_loc:Header&quot;}" > Sign in </a> </div> </div> <div class="HeaderMenu js-header-menu height-fit position-lg-relative d-lg-flex flex-column flex-auto top-0"> <div class="HeaderMenu-wrapper d-flex flex-column flex-self-start flex-lg-row flex-auto rounded rounded-lg-0"> <nav class="HeaderMenu-nav" aria-label="Global"> <ul class="d-lg-flex list-style-none"> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_copilot&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_copilot_link_product_navbar&quot;}" href="https://github.com/features/copilot"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">GitHub Copilot</div> Write better code with AI </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;security&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;security_link_product_navbar&quot;}" href="https://github.com/features/security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;actions&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;actions_link_product_navbar&quot;}" href="https://github.com/features/actions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path> </svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;codespaces&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;codespaces_link_product_navbar&quot;}" href="https://github.com/features/codespaces"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;issues&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;issues_link_product_navbar&quot;}" href="https://github.com/features/issues"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path> </svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;code_review&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;code_review_link_product_navbar&quot;}" href="https://github.com/features/code-review"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Review</div> Manage code changes </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;discussions&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;discussions_link_product_navbar&quot;}" href="https://github.com/features/discussions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;code_search&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;code_search_link_product_navbar&quot;}" href="https://github.com/features/code-search"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-square color-fg-subtle mr-3"> <path d="M10.3 8.24a.75.75 0 0 1-.04 1.06L7.352 12l2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M2 3.75C2 2.784 2.784 2 3.75 2h16.5c.966 0 1.75.784 1.75 1.75v16.5A1.75 1.75 0 0 1 20.25 22H3.75A1.75 1.75 0 0 1 2 20.25Zm1.75-.25a.25.25 0 0 0-.25.25v16.5c0 .138.112.25.25.25h16.5a.25.25 0 0 0 .25-.25V3.75a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Search</div> Find more, search less </div> </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="product-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="product-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;all_features&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;all_features_link_product_navbar&quot;}" href="https://github.com/features"> All features </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;documentation&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;documentation_link_product_navbar&quot;}" href="https://docs.github.com"> Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_skills&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_skills_link_product_navbar&quot;}" href="https://skills.github.com"> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;blog&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;blog_link_product_navbar&quot;}" href="https://github.blog"> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 pb-lg-3 mb-3 mb-lg-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-company-size-heading">By company size</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-company-size-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;enterprises&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;enterprises_link_solutions_navbar&quot;}" href="https://github.com/enterprise"> Enterprises </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;small_and_medium_teams&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;small_and_medium_teams_link_solutions_navbar&quot;}" href="https://github.com/team"> Small and medium teams </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;startups&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;startups_link_solutions_navbar&quot;}" href="https://github.com/enterprise/startups"> Startups </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-use-case-heading">By use case</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-use-case-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;devsecops&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;devsecops_link_solutions_navbar&quot;}" href="/solutions/use-case/devsecops"> DevSecOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;devops&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;devops_link_solutions_navbar&quot;}" href="/solutions/use-case/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;ci_cd&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;ci_cd_link_solutions_navbar&quot;}" href="/solutions/use-case/ci-cd"> CI/CD </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;view_all_use_cases&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;view_all_use_cases_link_solutions_navbar&quot;}" href="/solutions/use-case"> View all use cases </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-industry-heading">By industry</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-industry-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;healthcare&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;healthcare_link_solutions_navbar&quot;}" href="/solutions/industry/healthcare"> Healthcare </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;financial_services&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;financial_services_link_solutions_navbar&quot;}" href="/solutions/industry/financial-services"> Financial services </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;manufacturing&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;manufacturing_link_solutions_navbar&quot;}" href="/solutions/industry/manufacturing"> Manufacturing </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;government&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;government_link_solutions_navbar&quot;}" href="/solutions/industry/government"> Government </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;view_all_industries&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;view_all_industries_link_solutions_navbar&quot;}" href="/solutions/industry"> View all industries </a></li> </ul> </div> </div> <div class="HeaderMenu-trailing-link rounded-bottom-2 flex-shrink-0 mt-lg-4 px-lg-4 py-4 py-lg-3 f5 text-semibold"> <a href="/solutions"> View all solutions <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-right HeaderMenu-trailing-link-icon"> <path d="M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"></path> </svg> </a> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Resources <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-topics-heading">Topics</span> <ul class="list-style-none f5" aria-labelledby="resources-topics-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;ai&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;ai_link_resources_navbar&quot;}" href="/resources/articles/ai"> AI </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;devops&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;devops_link_resources_navbar&quot;}" href="/resources/articles/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;security&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;security_link_resources_navbar&quot;}" href="/resources/articles/security"> Security </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;software_development&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;software_development_link_resources_navbar&quot;}" href="/resources/articles/software-development"> Software Development </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;view_all&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;view_all_link_resources_navbar&quot;}" href="/resources/articles"> View all </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="resources-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;learning_pathways&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;learning_pathways_link_resources_navbar&quot;}" href="https://resources.github.com/learn/pathways"> Learning Pathways <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;white_papers_ebooks_webinars&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;white_papers_ebooks_webinars_link_resources_navbar&quot;}" href="https://resources.github.com"> White papers, Ebooks, Webinars <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;customer_stories&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;customer_stories_link_resources_navbar&quot;}" href="https://github.com/customer-stories"> Customer Stories </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;partners&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;partners_link_resources_navbar&quot;}" href="https://partner.github.com"> Partners <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_sponsors&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_sponsors_link_open_source_navbar&quot;}" href="/sponsors"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;the_readme_project&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;the_readme_project_link_open_source_navbar&quot;}" href="https://github.com/readme"> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="open-source-repositories-heading">Repositories</span> <ul class="list-style-none f5" aria-labelledby="open-source-repositories-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;topics&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;topics_link_open_source_navbar&quot;}" href="https://github.com/topics"> Topics </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;trending&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;trending_link_open_source_navbar&quot;}" href="https://github.com/trending"> Trending </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;collections&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;collections_link_open_source_navbar&quot;}" href="https://github.com/collections"> Collections </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Enterprise <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;enterprise_platform&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;enterprise_platform_link_enterprise_navbar&quot;}" href="/enterprise"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-stack color-fg-subtle mr-3"> <path d="M11.063 1.456a1.749 1.749 0 0 1 1.874 0l8.383 5.316a1.751 1.751 0 0 1 0 2.956l-8.383 5.316a1.749 1.749 0 0 1-1.874 0L2.68 9.728a1.751 1.751 0 0 1 0-2.956Zm1.071 1.267a.25.25 0 0 0-.268 0L3.483 8.039a.25.25 0 0 0 0 .422l8.383 5.316a.25.25 0 0 0 .268 0l8.383-5.316a.25.25 0 0 0 0-.422Z"></path><path d="M1.867 12.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path><path d="M1.867 16.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path> </svg> <div> <div class="color-fg-default h4">Enterprise platform</div> AI-powered developer platform </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="enterprise-available-add-ons-heading">Available add-ons</span> <ul class="list-style-none f5" aria-labelledby="enterprise-available-add-ons-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;advanced_security&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;advanced_security_link_enterprise_navbar&quot;}" href="https://github.com/enterprise/advanced-security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">Advanced Security</div> Enterprise-grade security features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_copilot&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_copilot_link_enterprise_navbar&quot;}" href="/features/copilot#enterprise"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">GitHub Copilot</div> Enterprise-grade AI features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;premium_support&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;premium_support_link_enterprise_navbar&quot;}" href="/premium-support"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Premium Support</div> Enterprise-grade 24/7 support </div> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <a class="HeaderMenu-link no-underline px-0 px-lg-2 py-3 py-lg-2 d-block d-lg-inline-block" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;pricing&quot;,&quot;context&quot;:&quot;global&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;pricing_link_global_navbar&quot;}" href="https://github.com/pricing">Pricing</a> </li> </ul> </nav> <div class="d-flex flex-column flex-lg-row width-full flex-justify-end flex-lg-items-center text-center mt-3 mt-lg-0 text-lg-left ml-lg-3"> <qbsearch-input class="search-input" data-scope="repo:MessagePack-CSharp/MessagePack-CSharp" data-custom-scopes-path="/search/custom_scopes" data-delete-custom-scopes-csrf="ZWO_wFAVPVu522_9aeBbGCfqOCnYsfBjXz4cwrU92cEK4SlH-XP0aY6mS6VJYnz3kOj1Nsy1Icg3AnbgXELItw" data-max-custom-scopes="10" data-header-redesign-enabled="false" data-initial-value="" data-blackbird-suggestions-path="/search/suggestions" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" data-current-repository="MessagePack-CSharp/MessagePack-CSharp" data-current-org="MessagePack-CSharp" data-current-owner="" data-logged-in="false" data-copilot-chat-enabled="false" data-nl-search-enabled="false" data-retain-scroll-position="true"> <div class="search-input-container search-with-dialog position-relative d-flex flex-row flex-items-center mr-4 rounded" data-action="click:qbsearch-input#searchInputContainerClicked" > <button type="button" class="header-search-button placeholder input-button form-control d-flex flex-1 flex-self-stretch flex-items-center no-wrap width-full py-0 pl-2 pr-0 text-left border-0 box-shadow-none" data-target="qbsearch-input.inputButton" aria-label="Search or jump to…" aria-haspopup="dialog" placeholder="Search or jump to..." data-hotkey=s,/ autocapitalize="off" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;searchbar&quot;,&quot;context&quot;:&quot;global&quot;,&quot;tag&quot;:&quot;input&quot;,&quot;label&quot;:&quot;searchbar_input_global_navbar&quot;}" data-action="click:qbsearch-input#handleExpand" > <div class="mr-2 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </div> <span class="flex-1" data-target="qbsearch-input.inputButtonText">Search or jump to...</span> <div class="d-flex" data-target="qbsearch-input.hotkeyIndicator"> <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> </div> </button> <input type="hidden" name="type" class="js-site-search-type-field"> <div class="Overlay--hidden " data-modal-dialog-overlay> <modal-dialog data-action="close:qbsearch-input#handleClose cancel:qbsearch-input#handleClose" data-target="qbsearch-input.searchSuggestionsDialog" role="dialog" id="search-suggestions-dialog" aria-modal="true" aria-labelledby="search-suggestions-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto"> <h1 id="search-suggestions-dialog-header" class="sr-only">Search code, repositories, users, issues, pull requests...</h1> <div class="Overlay-body Overlay-body--paddingNone"> <div data-view-component="true"> <div class="search-suggestions position-fixed width-full color-shadow-large border color-fg-default color-bg-default overflow-hidden d-flex flex-column query-builder-container" style="border-radius: 12px;" data-target="qbsearch-input.queryBuilderContainer" hidden > <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="query-builder-test-form" action="" accept-charset="UTF-8" method="get"> <query-builder data-target="qbsearch-input.queryBuilder" id="query-builder-query-builder-test" data-filter-key=":" data-view-component="true" class="QueryBuilder search-query-builder"> <div class="FormControl FormControl--fullWidth"> <label id="query-builder-test-label" for="query-builder-test" class="FormControl-label sr-only"> Search </label> <div class="QueryBuilder-StyledInput width-fit " data-target="query-builder.styledInput" > <span id="query-builder-test-leadingvisual-wrap" class="FormControl-input-leadingVisualWrap QueryBuilder-leadingVisualWrap"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search FormControl-input-leadingVisual"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </span> <div data-target="query-builder.styledInputContainer" class="QueryBuilder-StyledInputContainer"> <div aria-hidden="true" class="QueryBuilder-StyledInputContent" data-target="query-builder.styledInputContent" ></div> <div class="QueryBuilder-InputWrapper"> <div aria-hidden="true" class="QueryBuilder-Sizer" data-target="query-builder.sizer"></div> <input id="query-builder-test" name="query-builder-test" value="" autocomplete="off" type="text" role="combobox" spellcheck="false" aria-expanded="false" aria-describedby="validation-c2f7de90-a011-48a5-b4c3-5b4694ebd48b" data-target="query-builder.input" data-action=" input:query-builder#inputChange blur:query-builder#inputBlur keydown:query-builder#inputKeydown focus:query-builder#inputFocus " data-view-component="true" class="FormControl-input QueryBuilder-Input FormControl-medium" /> </div> </div> <span class="sr-only" id="query-builder-test-clear">Clear</span> <button role="button" id="query-builder-test-clear-button" aria-labelledby="query-builder-test-clear query-builder-test-label" data-target="query-builder.clearButton" data-action=" click:query-builder#clear focus:query-builder#clearButtonFocus blur:query-builder#clearButtonBlur " variant="small" hidden="hidden" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium mr-1 px-2 py-0 d-flex flex-items-center rounded-1 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x-circle-fill Button-visual"> <path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"></path> </svg> </button> </div> <template id="search-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </template> <template id="code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="file-code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-code"> <path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path> </svg> </template> <template id="history-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path> </svg> </template> <template id="repo-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> </template> <template id="bookmark-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bookmark"> <path d="M3 2.75C3 1.784 3.784 1 4.75 1h6.5c.966 0 1.75.784 1.75 1.75v11.5a.75.75 0 0 1-1.227.579L8 11.722l-3.773 3.107A.751.751 0 0 1 3 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.91l3.023-2.489a.75.75 0 0 1 .954 0l3.023 2.49V2.75a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="plus-circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-plus-circle"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm7.25-3.25v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> </template> <template id="trash-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-trash"> <path d="M11 1.75V3h2.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75ZM4.496 6.675l.66 6.6a.25.25 0 0 0 .249.225h5.19a.25.25 0 0 0 .249-.225l.66-6.6a.75.75 0 0 1 1.492.149l-.66 6.6A1.748 1.748 0 0 1 10.595 15h-5.19a1.75 1.75 0 0 1-1.741-1.575l-.66-6.6a.75.75 0 1 1 1.492-.15ZM6.5 1.75V3h3V1.75a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25Z"></path> </svg> </template> <template id="team-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-people"> <path d="M2 5.5a3.5 3.5 0 1 1 5.898 2.549 5.508 5.508 0 0 1 3.034 4.084.75.75 0 1 1-1.482.235 4 4 0 0 0-7.9 0 .75.75 0 0 1-1.482-.236A5.507 5.507 0 0 1 3.102 8.05 3.493 3.493 0 0 1 2 5.5ZM11 4a3.001 3.001 0 0 1 2.22 5.018 5.01 5.01 0 0 1 2.56 3.012.749.749 0 0 1-.885.954.752.752 0 0 1-.549-.514 3.507 3.507 0 0 0-2.522-2.372.75.75 0 0 1-.574-.73v-.352a.75.75 0 0 1 .416-.672A1.5 1.5 0 0 0 11 5.5.75.75 0 0 1 11 4Zm-5.5-.5a2 2 0 1 0-.001 3.999A2 2 0 0 0 5.5 3.5Z"></path> </svg> </template> <template id="project-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path> </svg> </template> <template id="pencil-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pencil"> <path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path> </svg> </template> <template id="copilot-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot"> <path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="copilot-error-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot-error"> <path d="M16 11.24c0 .112-.072.274-.21.467L13 9.688V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-.198 0-.388-.009-.571-.029L6.833 5.226a4.01 4.01 0 0 0 .17-.782c.117-.935-.037-1.395-.241-1.614-.193-.206-.637-.413-1.682-.297-.683.076-1.115.231-1.395.415l-1.257-.91c.579-.564 1.413-.877 2.485-.996 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095Zm-5.083-8.707c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Zm2.511 11.074c-1.393.776-3.272 1.428-5.43 1.428-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.18-.455-.241-.963-.252-1.475L.31 4.107A.747.747 0 0 1 0 3.509V3.49a.748.748 0 0 1 .625-.73c.156-.026.306.047.435.139l14.667 10.578a.592.592 0 0 1 .227.264.752.752 0 0 1 .046.249v.022a.75.75 0 0 1-1.19.596Zm-1.367-.991L5.635 7.964a5.128 5.128 0 0 1-.889.073c-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433 1.539 0 3.089-.505 4.063-.934Z"></path> </svg> </template> <template id="workflow-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-workflow"> <path d="M0 1.75C0 .784.784 0 1.75 0h3.5C6.216 0 7 .784 7 1.75v3.5A1.75 1.75 0 0 1 5.25 7H4v4a1 1 0 0 0 1 1h4v-1.25C9 9.784 9.784 9 10.75 9h3.5c.966 0 1.75.784 1.75 1.75v3.5A1.75 1.75 0 0 1 14.25 16h-3.5A1.75 1.75 0 0 1 9 14.25v-.75H5A2.5 2.5 0 0 1 2.5 11V7h-.75A1.75 1.75 0 0 1 0 5.25Zm1.75-.25a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Zm9 9a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="book-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> </template> <template id="code-review-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-review"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 13H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25v-8.5C0 1.784.784 1 1.75 1ZM1.5 2.75v8.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm5.28 1.72a.75.75 0 0 1 0 1.06L5.31 7l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.75.75 0 0 1 1.06 0Zm2.44 0a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L10.69 7 9.22 5.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="codespaces-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-codespaces"> <path d="M0 11.25c0-.966.784-1.75 1.75-1.75h12.5c.966 0 1.75.784 1.75 1.75v3A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm2-9.5C2 .784 2.784 0 3.75 0h8.5C13.216 0 14 .784 14 1.75v5a1.75 1.75 0 0 1-1.75 1.75h-8.5A1.75 1.75 0 0 1 2 6.75Zm1.75-.25a.25.25 0 0 0-.25.25v5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5a.25.25 0 0 0-.25-.25Zm-2 9.5a.25.25 0 0 0-.25.25v3c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-3a.25.25 0 0 0-.25-.25Z"></path><path d="M7 12.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> </template> <template id="comment-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment"> <path d="M1 2.75C1 1.784 1.784 1 2.75 1h10.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 13.25 12H9.06l-2.573 2.573A1.458 1.458 0 0 1 4 13.543V12H2.75A1.75 1.75 0 0 1 1 10.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h4.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="comment-discussion-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment-discussion"> <path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path> </svg> </template> <template id="organization-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-organization"> <path d="M1.75 16A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0h8.5C11.216 0 12 .784 12 1.75v12.5c0 .085-.006.168-.018.25h2.268a.25.25 0 0 0 .25-.25V8.285a.25.25 0 0 0-.111-.208l-1.055-.703a.749.749 0 1 1 .832-1.248l1.055.703c.487.325.779.871.779 1.456v5.965A1.75 1.75 0 0 1 14.25 16h-3.5a.766.766 0 0 1-.197-.026c-.099.017-.2.026-.303.026h-3a.75.75 0 0 1-.75-.75V14h-1v1.25a.75.75 0 0 1-.75.75Zm-.25-1.75c0 .138.112.25.25.25H4v-1.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 .75.75v1.25h2.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM3.75 6h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 3.75A.75.75 0 0 1 3.75 3h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 3.75Zm4 3A.75.75 0 0 1 7.75 6h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 7 6.75ZM7.75 3h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 9.75A.75.75 0 0 1 3.75 9h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 9.75ZM7.75 9h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="rocket-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-rocket"> <path d="M14.064 0h.186C15.216 0 16 .784 16 1.75v.186a8.752 8.752 0 0 1-2.564 6.186l-.458.459c-.314.314-.641.616-.979.904v3.207c0 .608-.315 1.172-.833 1.49l-2.774 1.707a.749.749 0 0 1-1.11-.418l-.954-3.102a1.214 1.214 0 0 1-.145-.125L3.754 9.816a1.218 1.218 0 0 1-.124-.145L.528 8.717a.749.749 0 0 1-.418-1.11l1.71-2.774A1.748 1.748 0 0 1 3.31 4h3.204c.288-.338.59-.665.904-.979l.459-.458A8.749 8.749 0 0 1 14.064 0ZM8.938 3.623h-.002l-.458.458c-.76.76-1.437 1.598-2.02 2.5l-1.5 2.317 2.143 2.143 2.317-1.5c.902-.583 1.74-1.26 2.499-2.02l.459-.458a7.25 7.25 0 0 0 2.123-5.127V1.75a.25.25 0 0 0-.25-.25h-.186a7.249 7.249 0 0 0-5.125 2.123ZM3.56 14.56c-.732.732-2.334 1.045-3.005 1.148a.234.234 0 0 1-.201-.064.234.234 0 0 1-.064-.201c.103-.671.416-2.273 1.15-3.003a1.502 1.502 0 1 1 2.12 2.12Zm6.94-3.935c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 0 0 .119-.213ZM3.678 8.116 5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 0 0-.213.119l-1.2 1.95ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </template> <template id="shield-check-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield-check"> <path d="m8.533.133 5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667l5.25-1.68a1.748 1.748 0 0 1 1.066 0Zm-.61 1.429.001.001-5.25 1.68a.251.251 0 0 0-.174.237V7c0 1.36.275 2.666 1.057 3.859.784 1.194 2.121 2.342 4.366 3.298a.196.196 0 0 0 .154 0c2.245-.957 3.582-2.103 4.366-3.297C13.225 9.666 13.5 8.358 13.5 7V3.48a.25.25 0 0 0-.174-.238l-5.25-1.68a.25.25 0 0 0-.153 0ZM11.28 6.28l-3.5 3.5a.75.75 0 0 1-1.06 0l-1.5-1.5a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l.97.97 2.97-2.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="heart-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-heart"> <path d="m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z"></path> </svg> </template> <template id="server-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-server"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v4c0 .372-.116.717-.314 1 .198.283.314.628.314 1v4a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 12.75v-4c0-.358.109-.707.314-1a1.739 1.739 0 0 1-.314-1v-4C0 1.784.784 1 1.75 1ZM1.5 2.75v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm.25 5.75a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25ZM7 4.75A.75.75 0 0 1 7.75 4h4.5a.75.75 0 0 1 0 1.5h-4.5A.75.75 0 0 1 7 4.75ZM7.75 10h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM3 4.75A.75.75 0 0 1 3.75 4h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 4.75ZM3.75 10h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="globe-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-globe"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.363 4.177c.255.426.542.832.857 1.215.245-.296.551-.705.857-1.215A9.64 9.64 0 0 0 10.22 8.75Zm4.44-1.5a9.64 9.64 0 0 0-1.363-4.177c-.307-.51-.612-.919-.857-1.215a9.927 9.927 0 0 0-.857 1.215A9.64 9.64 0 0 0 5.78 7.25Zm-5.944 1.5H1.543a6.507 6.507 0 0 0 4.666 5.5c-.123-.181-.24-.365-.352-.552-.715-1.192-1.437-2.874-1.581-4.948Zm-2.733-1.5h2.733c.144-2.074.866-3.756 1.58-4.948.12-.197.237-.381.353-.552a6.507 6.507 0 0 0-4.666 5.5Zm10.181 1.5c-.144 2.074-.866 3.756-1.58 4.948-.12.197-.237.381-.353.552a6.507 6.507 0 0 0 4.666-5.5Zm2.733-1.5a6.507 6.507 0 0 0-4.666-5.5c.123.181.24.365.353.552.714 1.192 1.436 2.874 1.58 4.948Z"></path> </svg> </template> <template id="issue-opened-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> </template> <template id="device-mobile-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-mobile"> <path d="M3.75 0h8.5C13.216 0 14 .784 14 1.75v12.5A1.75 1.75 0 0 1 12.25 16h-8.5A1.75 1.75 0 0 1 2 14.25V1.75C2 .784 2.784 0 3.75 0ZM3.5 1.75v12.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM8 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path> </svg> </template> <template id="package-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-package"> <path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"></path> </svg> </template> <template id="credit-card-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-credit-card"> <path d="M10.75 9a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5h-1.5Z"></path><path d="M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25ZM14.5 6.5h-13v5.75c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25Zm0-2.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25V5h13Z"></path> </svg> </template> <template id="play-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </template> <template id="gift-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-gift"> <path d="M2 2.75A2.75 2.75 0 0 1 4.75 0c.983 0 1.873.42 2.57 1.232.268.318.497.668.68 1.042.183-.375.411-.725.68-1.044C9.376.42 10.266 0 11.25 0a2.75 2.75 0 0 1 2.45 4h.55c.966 0 1.75.784 1.75 1.75v2c0 .698-.409 1.301-1 1.582v4.918A1.75 1.75 0 0 1 13.25 16H2.75A1.75 1.75 0 0 1 1 14.25V9.332C.409 9.05 0 8.448 0 7.75v-2C0 4.784.784 4 1.75 4h.55c-.192-.375-.3-.8-.3-1.25ZM7.25 9.5H2.5v4.75c0 .138.112.25.25.25h4.5Zm1.5 0v5h4.5a.25.25 0 0 0 .25-.25V9.5Zm0-4V8h5.5a.25.25 0 0 0 .25-.25v-2a.25.25 0 0 0-.25-.25Zm-7 0a.25.25 0 0 0-.25.25v2c0 .138.112.25.25.25h5.5V5.5h-5.5Zm3-4a1.25 1.25 0 0 0 0 2.5h2.309c-.233-.818-.542-1.401-.878-1.793-.43-.502-.915-.707-1.431-.707ZM8.941 4h2.309a1.25 1.25 0 0 0 0-2.5c-.516 0-1 .205-1.43.707-.337.392-.646.975-.879 1.793Z"></path> </svg> </template> <template id="code-square-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-square"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="device-desktop-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-desktop"> <path d="M14.25 1c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.752.752 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5C0 1.784.784 1 1.75 1ZM1.75 2.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25ZM9.018 12H6.982a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5Z"></path> </svg> </template> <div class="position-relative"> <ul role="listbox" class="ActionListWrap QueryBuilder-ListWrap" aria-label="Suggestions" data-action=" combobox-commit:query-builder#comboboxCommit mousedown:query-builder#resultsMousedown " data-target="query-builder.resultsList" data-persist-list=false id="query-builder-test-results" ></ul> </div> <div class="FormControl-inlineValidation" id="validation-c2f7de90-a011-48a5-b4c3-5b4694ebd48b" hidden="hidden"> <span class="FormControl-inlineValidation--visual"> <svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill"> <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path> </svg> </span> <span></span> </div> </div> <div data-target="query-builder.screenReaderFeedback" aria-live="polite" aria-atomic="true" class="sr-only"></div> </query-builder></form> <div class="d-flex flex-row color-fg-muted px-3 text-small color-bg-default search-feedback-prompt"> <a target="_blank" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax" data-view-component="true" class="Link color-fg-accent text-normal ml-2"> Search syntax tips </a> <div class="d-flex flex-1"></div> </div> </div> </div> </div> </modal-dialog></div> </div> <div data-action="click:qbsearch-input#retract" class="dark-backdrop position-fixed" hidden data-target="qbsearch-input.darkBackdrop"></div> <div class="color-fg-default"> <dialog-helper> <dialog data-target="qbsearch-input.feedbackDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="feedback-dialog" aria-modal="true" aria-labelledby="feedback-dialog-title" aria-describedby="feedback-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="feedback-dialog-title"> Provide feedback </h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="feedback-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="feedback-dialog-title"> <div data-view-component="true" class="Overlay-body"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="code-search-feedback-form" data-turbo="false" action="/search/feedback" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="MdjX/CbzvR8lIoHM2dLybcDQFFVlIzozOEvQDrAFO3NlFLHBD4cHSnq2JfAmUtopCwdOs7ZSz9i8c6jBHJX0DQ==" /> <p>We read every piece of feedback, and take your input very seriously.</p> <textarea name="feedback" class="form-control width-full mb-2" style="height: 120px" id="feedback"></textarea> <input name="include_email" id="include_email" aria-label="Include my email address so I can be contacted" class="form-control mr-2" type="checkbox"> <label for="include_email" style="font-weight: normal">Include my email address so I can be contacted</label> </form></div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="feedback-dialog" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="code-search-feedback-form" data-action="click:qbsearch-input#submitFeedback" type="submit" data-view-component="true" class="btn-primary btn"> Submit feedback </button> </div> </dialog></dialog-helper> <custom-scopes data-target="qbsearch-input.customScopesManager"> <dialog-helper> <dialog data-target="custom-scopes.customScopesModalDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="custom-scopes-dialog" aria-modal="true" aria-labelledby="custom-scopes-dialog-title" aria-describedby="custom-scopes-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="custom-scopes-dialog-title"> Saved searches </h1> <h2 id="custom-scopes-dialog-description" class="Overlay-description">Use saved searches to filter your results more quickly</h2> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="custom-scopes-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="custom-scopes-dialog-title"> <div data-view-component="true" class="Overlay-body"> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <div hidden class="create-custom-scope-form" data-target="custom-scopes.createCustomScopeForm"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="custom-scopes-dialog-form" data-turbo="false" action="/search/custom_scopes" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="AMQc/vtQvMssS9sHpf588EK+2RFTyElb4aRsfvfx6CAS/Z/jVkufX1bB1pBC1XRPqqhQnIHEeoPit2taGZLTdQ==" /> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <input type="hidden" id="custom_scope_id" name="custom_scope_id" data-target="custom-scopes.customScopesIdField"> <div class="form-group"> <label for="custom_scope_name">Name</label> <auto-check src="/search/custom_scopes/check_name" required> <input type="text" name="custom_scope_name" id="custom_scope_name" data-target="custom-scopes.customScopesNameField" class="form-control" autocomplete="off" placeholder="github-ruby" required maxlength="50"> <input type="hidden" data-csrf="true" value="nk7gqb5mIZ+GOq/gVf/2lZuNBUuzP6gL0/g6MsgdTGg4zCPZBMiFrflv+L2el3Zmy8G6oxTcAgHlaceO21gmzg==" /> </auto-check> </div> <div class="form-group"> <label for="custom_scope_query">Query</label> <input type="text" name="custom_scope_query" id="custom_scope_query" data-target="custom-scopes.customScopesQueryField" class="form-control" autocomplete="off" placeholder="(repo:mona/a OR repo:mona/b) AND lang:python" required maxlength="500"> </div> <p class="text-small color-fg-muted"> To see all available qualifiers, see our <a class="Link--inTextBlock" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax">documentation</a>. </p> </form> </div> <div data-target="custom-scopes.manageCustomScopesForm"> <div data-target="custom-scopes.list"></div> </div> </div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd Overlay-footer--divided"> <button data-action="click:custom-scopes#customScopesCancel" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="custom-scopes-dialog-form" data-action="click:custom-scopes#customScopesSubmit" data-target="custom-scopes.customScopesSubmitButton" type="submit" data-view-component="true" class="btn-primary btn"> Create saved search </button> </div> </dialog></dialog-helper> </custom-scopes> </div> </qbsearch-input> <div class="position-relative HeaderMenu-link-wrap d-lg-inline-block"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2FMessagePack-CSharp%2FMessagePack-CSharp" class="HeaderMenu-link HeaderMenu-link--sign-in HeaderMenu-button flex-shrink-0 no-underline d-none d-lg-inline-flex border border-lg-0 rounded rounded-lg-0 px-2 py-1" style="margin-left: 12px;" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/MessagePack-CSharp/MessagePack-CSharp&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="5a0a18e6ccc25c196c4ef3193a3410b17ab6ae92051703be6c4a58b21d54a513" data-analytics-event="{&quot;category&quot;:&quot;Marketing nav&quot;,&quot;action&quot;:&quot;click to go to homepage&quot;,&quot;label&quot;:&quot;ref_page:Marketing;ref_cta:Sign in;ref_loc:Header&quot;}" > Sign in </a> </div> <a href="/signup?ref_cta=Sign+up&amp;ref_loc=header+logged+out&amp;ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&amp;source=header-repo&amp;source_repo=MessagePack-CSharp%2FMessagePack-CSharp" class="HeaderMenu-link HeaderMenu-link--sign-up HeaderMenu-button flex-shrink-0 d-flex d-lg-inline-flex no-underline border color-border-default rounded px-2 py-1" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/MessagePack-CSharp/MessagePack-CSharp&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="5a0a18e6ccc25c196c4ef3193a3410b17ab6ae92051703be6c4a58b21d54a513" data-analytics-event="{&quot;category&quot;:&quot;Sign up&quot;,&quot;action&quot;:&quot;click to sign up for account&quot;,&quot;label&quot;:&quot;ref_page:/&lt;user-name&gt;/&lt;repo-name&gt;;ref_cta:Sign up;ref_loc:header logged out&quot;}" > Sign up </a> <button type="button" class="sr-only js-header-menu-focus-trap d-block d-lg-none">Reseting focus</button> </div> </div> </div> </div> </header> <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-switched" hidden>You switched accounts on another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <button id="icon-button-67184c6a-a3a5-4a4c-a8e7-9b453678464b" aria-labelledby="tooltip-2cbc6b1b-5369-4710-b077-b7c9b46b3891" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button><tool-tip id="tooltip-2cbc6b1b-5369-4710-b077-b7c9b46b3891" for="icon-button-67184c6a-a3a5-4a4c-a8e7-9b453678464b" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Dismiss alert</tool-tip> </div> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" class="flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div> </div> </template> </div> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--page-header-bgColor, var(--color-page-header-bg));" data-turbo-replace> <div class="d-flex flex-nowrap flex-justify-end mb-3 px-3 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <span class="author flex-self-stretch" itemprop="author"> <a class="url fn" rel="author" data-hovercard-type="organization" data-hovercard-url="/orgs/MessagePack-CSharp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/MessagePack-CSharp"> MessagePack-CSharp </a> </span> <span class="mx-1 flex-self-stretch color-fg-muted">/</span> <strong itemprop="name" class="mr-2 flex-self-stretch"> <a data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/MessagePack-CSharp/MessagePack-CSharp">MessagePack-CSharp</a> </strong> <span></span><span class="Label Label--secondary v-align-middle mr-1">Public</span> </div> </div> <div id="repository-details-container" class="flex-shrink-0" data-turbo-replace style="max-width: 70%;"> <ul class="pagehead-actions flex-shrink-0 d-none d-md-inline" style="padding: 2px 0;"> <li> <include-fragment src="/MessagePack-CSharp/MessagePack-CSharp/sponsor_button"></include-fragment> </li> <li> <a href="/login?return_to=%2FMessagePack-CSharp%2FMessagePack-CSharp" rel="nofollow" id="repository-details-watch-button" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;notification subscription menu watch&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/MessagePack-CSharp/MessagePack-CSharp&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="d32bbc818a3767f01a23d166279402397ad376119f869dd2f89558a6ec501f59" aria-label="You must be signed in to change notification settings" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path> </svg>Notifications </a> <tool-tip id="tooltip-d33b0dc1-97b3-4062-8377-918a58274ed4" for="repository-details-watch-button" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to change notification settings</tool-tip> </li> <li> <a icon="repo-forked" id="fork-button" href="/login?return_to=%2FMessagePack-CSharp%2FMessagePack-CSharp" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;repo details fork button&quot;,&quot;repository_id&quot;:81770291,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/MessagePack-CSharp/MessagePack-CSharp&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="33053e05e2634238163759ec9cdb81538efa045f70ecceae82f4ae591f48a2a6" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg>Fork <span id="repo-network-counter" data-pjax-replace="true" data-turbo-replace="true" title="700" data-view-component="true" class="Counter">700</span> </a> </li> <li> <div data-view-component="true" class="BtnGroup d-flex"> <a href="/login?return_to=%2FMessagePack-CSharp%2FMessagePack-CSharp" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;star button&quot;,&quot;repository_id&quot;:81770291,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/MessagePack-CSharp/MessagePack-CSharp&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="35facfebfe85e3b0f48486e4d81e6196ed7bc31892dbe4735a5a12a6ff398715" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-sw btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg><span data-view-component="true" class="d-inline"> Star </span> <span id="repo-stars-counter-star" aria-label="5819 users starred this repository" data-singular-suffix="user starred this repository" data-plural-suffix="users starred this repository" data-turbo-replace="true" title="5,819" data-view-component="true" class="Counter js-social-count">5.8k</span> </a></div> </li> </ul> </div> </div> <div id="responsive-meta-container" data-turbo-replace> <div class="d-block d-md-none mb-2 px-3 px-md-4 px-lg-5"> <p class="f4 mb-3 "> Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] </p> <h3 class="sr-only">License</h3> <div class="mb-2"> <a href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/LICENSE" class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:license&quot;}" > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-law mr-2"> <path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path> </svg> View license </a> </div> <div class="mb-3"> <a class="Link--secondary no-underline mr-3" href="/MessagePack-CSharp/MessagePack-CSharp/stargazers"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star mr-1"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> <span class="text-bold">5.8k</span> stars </a> <a class="Link--secondary no-underline mr-3" href="/MessagePack-CSharp/MessagePack-CSharp/forks"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-1"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg> <span class="text-bold">700</span> forks </a> <a class="Link--secondary no-underline mr-3 d-inline-block" href="/MessagePack-CSharp/MessagePack-CSharp/branches"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch mr-1"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path> </svg> <span>Branches</span> </a> <a class="Link--secondary no-underline d-inline-block" href="/MessagePack-CSharp/MessagePack-CSharp/tags"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-tag mr-1"> <path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path> </svg> <span>Tags</span> </a> <a class="Link--secondary no-underline d-inline-block" href="/MessagePack-CSharp/MessagePack-CSharp/activity"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pulse mr-1"> <path d="M6 2c.306 0 .582.187.696.471L10 10.731l1.304-3.26A.751.751 0 0 1 12 7h3.25a.75.75 0 0 1 0 1.5h-2.742l-1.812 4.528a.751.751 0 0 1-1.392 0L6 4.77 4.696 8.03A.75.75 0 0 1 4 8.5H.75a.75.75 0 0 1 0-1.5h2.742l1.812-4.529A.751.751 0 0 1 6 2Z"></path> </svg> <span>Activity</span> </a> </div> <div class="d-flex flex-wrap gap-2"> <div class="flex-1"> <div data-view-component="true" class="BtnGroup d-flex"> <a href="/login?return_to=%2FMessagePack-CSharp%2FMessagePack-CSharp" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;star button&quot;,&quot;repository_id&quot;:81770291,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/MessagePack-CSharp/MessagePack-CSharp&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="35facfebfe85e3b0f48486e4d81e6196ed7bc31892dbe4735a5a12a6ff398715" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-sw btn-sm btn btn-block"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg><span data-view-component="true" class="d-inline"> Star </span> </a></div> </div> <div class="flex-1"> <a href="/login?return_to=%2FMessagePack-CSharp%2FMessagePack-CSharp" rel="nofollow" id="files-overview-watch-button" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;notification subscription menu watch&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/MessagePack-CSharp/MessagePack-CSharp&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="d32bbc818a3767f01a23d166279402397ad376119f869dd2f89558a6ec501f59" aria-label="You must be signed in to change notification settings" data-view-component="true" class="btn-sm btn btn-block"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path> </svg>Notifications </a> <tool-tip id="tooltip-a2cc74cc-db69-4882-b4d4-bf676b1a23af" for="files-overview-watch-button" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to change notification settings</tool-tip> </div> <span> </span> </div> </div> </div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <ul data-view-component="true" class="UnderlineNav-body list-style-none"> <li data-view-component="true" class="d-inline-flex"> <a id="code-tab" href="/MessagePack-CSharp/MessagePack-CSharp" data-tab-item="i0code-tab" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages repo_deployments repo_attestations /MessagePack-CSharp/MessagePack-CSharp" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g c" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Code&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" aria-current="page" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item selected"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> <span data-content="Code">Code</span> <span id="code-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="issues-tab" href="/MessagePack-CSharp/MessagePack-CSharp/issues" data-tab-item="i1issues-tab" data-selected-links="repo_issues repo_labels repo_milestones /MessagePack-CSharp/MessagePack-CSharp/issues" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g i" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Issues&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> <span data-content="Issues">Issues</span> <span id="issues-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="70" data-view-component="true" class="Counter">70</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="pull-requests-tab" href="/MessagePack-CSharp/MessagePack-CSharp/pulls" data-tab-item="i2pull-requests-tab" data-selected-links="repo_pulls checks /MessagePack-CSharp/MessagePack-CSharp/pulls" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g p" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Pull requests&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> <span data-content="Pull requests">Pull requests</span> <span id="pull-requests-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="6" data-view-component="true" class="Counter">6</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="discussions-tab" href="/MessagePack-CSharp/MessagePack-CSharp/discussions" data-tab-item="i3discussions-tab" data-selected-links="repo_discussions /MessagePack-CSharp/MessagePack-CSharp/discussions" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g g" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Discussions&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment-discussion UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path> </svg> <span data-content="Discussions">Discussions</span> <span id="discussions-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="actions-tab" href="/MessagePack-CSharp/MessagePack-CSharp/actions" data-tab-item="i4actions-tab" data-selected-links="repo_actions /MessagePack-CSharp/MessagePack-CSharp/actions" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g a" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Actions&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> <span data-content="Actions">Actions</span> <span id="actions-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="projects-tab" href="/MessagePack-CSharp/MessagePack-CSharp/projects" data-tab-item="i5projects-tab" data-selected-links="repo_projects new_repo_project repo_project /MessagePack-CSharp/MessagePack-CSharp/projects" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g b" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Projects&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> <span data-content="Projects">Projects</span> <span id="projects-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="0" hidden="hidden" data-view-component="true" class="Counter">0</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="security-tab" href="/MessagePack-CSharp/MessagePack-CSharp/security" data-tab-item="i6security-tab" data-selected-links="security overview alerts policy token_scanning code_scanning /MessagePack-CSharp/MessagePack-CSharp/security" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g s" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Security&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span data-content="Security">Security</span> <include-fragment src="/MessagePack-CSharp/MessagePack-CSharp/security/overall-count" accept="text/fragment+html"></include-fragment> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="insights-tab" href="/MessagePack-CSharp/MessagePack-CSharp/pulse" data-tab-item="i7insights-tab" data-selected-links="repo_graphs repo_contributors dependency_graph dependabot_updates pulse people community /MessagePack-CSharp/MessagePack-CSharp/pulse" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Insights&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> <span data-content="Insights">Insights</span> <span id="insights-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> </ul> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <action-menu data-select-variant="none" data-view-component="true"> <focus-group direction="vertical" mnemonics retain> <button id="action-menu-7ea684b9-75d7-47c0-a6d6-84d9e8982753-button" popovertarget="action-menu-7ea684b9-75d7-47c0-a6d6-84d9e8982753-overlay" aria-controls="action-menu-7ea684b9-75d7-47c0-a6d6-84d9e8982753-list" aria-haspopup="true" aria-labelledby="tooltip-61172ad4-ecf4-4a0e-b665-172146328c0a" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--medium UnderlineNav-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal Button-visual"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> </button><tool-tip id="tooltip-61172ad4-ecf4-4a0e-b665-172146328c0a" for="action-menu-7ea684b9-75d7-47c0-a6d6-84d9e8982753-button" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Additional navigation options</tool-tip> <anchored-position id="action-menu-7ea684b9-75d7-47c0-a6d6-84d9e8982753-overlay" anchor="action-menu-7ea684b9-75d7-47c0-a6d6-84d9e8982753-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list> <div data-view-component="true"> <ul aria-labelledby="action-menu-7ea684b9-75d7-47c0-a6d6-84d9e8982753-button" id="action-menu-7ea684b9-75d7-47c0-a6d6-84d9e8982753-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap"> <li hidden="hidden" data-menu-item="i0code-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-7568b7b2-ca5f-4c7d-969c-1a0af896c3e6" href="/MessagePack-CSharp/MessagePack-CSharp" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Code </span> </a> </li> <li hidden="hidden" data-menu-item="i1issues-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-2f02c082-ec88-4028-8220-857eaf5d3357" href="/MessagePack-CSharp/MessagePack-CSharp/issues" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Issues </span> </a> </li> <li hidden="hidden" data-menu-item="i2pull-requests-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-c316e0da-4fc2-46d4-a401-3843651d6f15" href="/MessagePack-CSharp/MessagePack-CSharp/pulls" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Pull requests </span> </a> </li> <li hidden="hidden" data-menu-item="i3discussions-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-5648cbbc-a12b-4ca8-a9e1-d9b782ff516e" href="/MessagePack-CSharp/MessagePack-CSharp/discussions" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment-discussion"> <path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Discussions </span> </a> </li> <li hidden="hidden" data-menu-item="i4actions-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-f49ee509-3c8c-46b5-b751-5227f385f48e" href="/MessagePack-CSharp/MessagePack-CSharp/actions" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Actions </span> </a> </li> <li hidden="hidden" data-menu-item="i5projects-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-88e93db6-1219-484e-aaa1-ed70d8a24b4e" href="/MessagePack-CSharp/MessagePack-CSharp/projects" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Projects </span> </a> </li> <li hidden="hidden" data-menu-item="i6security-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-0c032d4b-3aca-4778-ad5f-d9decbca11c6" href="/MessagePack-CSharp/MessagePack-CSharp/security" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Security </span> </a> </li> <li hidden="hidden" data-menu-item="i7insights-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-88cf1886-343f-457a-ae05-08a3a40b594e" href="/MessagePack-CSharp/MessagePack-CSharp/pulse" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Insights </span> </a> </li> </ul> </div></action-list> </div> </div></anchored-position> </focus-group> </action-menu></div> </nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <h1 class='sr-only'>MessagePack-CSharp/MessagePack-CSharp</h1> <div class="clearfix container-xl px-md-4 px-lg-5 px-3"> <div> <div style="max-width: 100%" data-view-component="true" class="Layout Layout--flowRow-until-md react-repos-overview-margin Layout--sidebarPosition-end Layout--sidebarPosition-flowRow-end"> <div data-view-component="true" class="Layout-main"> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/primer-react-765944243383.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-core-cd0a67881543.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-lib-7b7b5264f6c1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/octicons-react-45c3a19dd792.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_tanstack_query-core_build_modern_queryClient_js-e40bb86d3e93.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_emotion_is-prop-valid_dist_emotion-is-prop-valid_esm_js-node_modules_emo-37e3d5-31653d7f2342.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-e7dcdd-285fc29e9fa5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover-fn_js-4896ddd4b7bb.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_tanstack_query-core_build_modern_queryObserver_js-node_modules_tanstack_-defd52-585c05e837f3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_hydro-analytics-client_dist_analytics-client_js-node_modules_gith-9002b0-8e5e346f0cbe.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_aria-live_aria-live_ts-ui_packages_promise-with-resolvers-polyfill_promise-with-r-014121-e1792bd5a31e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_paths_index_ts-c733d4a976df.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ref-selector_RefSelector_tsx-b10086b6761e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_hydro-analytics_hydro-analytics_ts-ui_packages_verified-fetch_verified-fetch_ts-u-4672d1-0996d093463a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_code-view-shared_hooks_use-file-page-payload_ts-ui_packages_code-view-shared_comp-1beb66-b07e414af699.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_commit-attribution_index_ts-ui_packages_commit-checks-status_index_ts-ui_packages-7207c9-f3f10560fb6f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repos-overview-5b8b9c05acbf.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.9fa170e9435ed4b922b9.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repos-overview.9cc263aa0716ce801059.module.css" /> <react-partial partial-name="repos-overview" data-ssr="true" data-attempted-ssr="true" > <script type="application/json" data-target="react-partial.embeddedData">{"props":{"initialPayload":{"allShortcutsEnabled":false,"path":"/","repo":{"id":81770291,"defaultBranch":"master","name":"MessagePack-CSharp","ownerLogin":"MessagePack-CSharp","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2017-02-13T00:58:41.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/138041803?v=4","public":true,"private":false,"isOrgOwned":true},"currentUser":null,"refInfo":{"name":"master","listCacheKey":"v0:1731589077.0","canEdit":false,"refType":"branch","currentOid":"e6f3d81f96578595c675966747dfdd5cac26528a"},"tree":{"items":[{"name":".devcontainer","path":".devcontainer","contentType":"directory"},{"name":".github","path":".github","contentType":"directory"},{"name":".vscode","path":".vscode","contentType":"directory"},{"name":"azure-pipelines","path":"azure-pipelines","contentType":"directory"},{"name":"benchmark","path":"benchmark","contentType":"directory"},{"name":"doc","path":"doc","contentType":"directory"},{"name":"sandbox","path":"sandbox","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":"tests","path":"tests","contentType":"directory"},{"name":"tools","path":"tools","contentType":"directory"},{"name":".editorconfig","path":".editorconfig","contentType":"file"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","contentType":"file"},{"name":"CONTRIBUTORS","path":"CONTRIBUTORS","contentType":"file"},{"name":"Directory.Build.props","path":"Directory.Build.props","contentType":"file"},{"name":"Directory.Build.rsp","path":"Directory.Build.rsp","contentType":"file"},{"name":"Directory.Build.targets","path":"Directory.Build.targets","contentType":"file"},{"name":"Directory.Packages.props","path":"Directory.Packages.props","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"MessagePack.sln","path":"MessagePack.sln","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"SECURITY.md","path":"SECURITY.md","contentType":"file"},{"name":"azure-pipelines.yml","path":"azure-pipelines.yml","contentType":"file"},{"name":"global.json","path":"global.json","contentType":"file"},{"name":"graph.xlsx","path":"graph.xlsx","contentType":"file"},{"name":"init.cmd","path":"init.cmd","contentType":"file"},{"name":"init.ps1","path":"init.ps1","contentType":"file"},{"name":"installcredprovider.ps1","path":"installcredprovider.ps1","contentType":"file"},{"name":"nuget.config","path":"nuget.config","contentType":"file"},{"name":"opensource.snk","path":"opensource.snk","contentType":"file"},{"name":"prepare_release.ps1","path":"prepare_release.ps1","contentType":"file"},{"name":"stylecop.json","path":"stylecop.json","contentType":"file"},{"name":"version.json","path":"version.json","contentType":"file"}],"templateDirectorySuggestionUrl":null,"readme":null,"totalCount":34,"showBranchInfobar":false},"fileTree":null,"fileTreeProcessingTime":null,"foldersToFetch":[],"treeExpanded":false,"symbolsExpanded":false,"isOverview":true,"overview":{"banners":{"shouldRecommendReadme":false,"isPersonalRepo":false,"showUseActionBanner":false,"actionSlug":null,"actionId":null,"showProtectBranchBanner":false,"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_repo","releasePath":"/MessagePack-CSharp/MessagePack-CSharp/releases/new?marketplace=true","showPublishActionBanner":false},"interactionLimitBanner":null,"showInvitationBanner":false,"inviterName":null,"actionsMigrationBannerInfo":{"releaseTags":[],"showImmutableActionsMigrationBanner":false,"initialMigrationStatus":null}},"codeButton":{"contactPath":"/contact","isEnterprise":false,"local":{"protocolInfo":{"httpAvailable":true,"sshAvailable":null,"httpUrl":"https://github.com/MessagePack-CSharp/MessagePack-CSharp.git","showCloneWarning":null,"sshUrl":null,"sshCertificatesRequired":null,"sshCertificatesAvailable":null,"ghCliUrl":"gh repo clone MessagePack-CSharp/MessagePack-CSharp","defaultProtocol":"http","newSshKeyUrl":"/settings/ssh/new","setProtocolPath":"/users/set_protocol"},"platformInfo":{"cloneUrl":"https://desktop.github.com","showVisualStudioCloneButton":false,"visualStudioCloneUrl":"https://windows.github.com","showXcodeCloneButton":false,"xcodeCloneUrl":"xcode://clone?repo=https%3A%2F%2Fgithub.com%2FMessagePack-CSharp%2FMessagePack-CSharp","zipballUrl":"/MessagePack-CSharp/MessagePack-CSharp/archive/refs/heads/master.zip"}},"newCodespacePath":"/codespaces/new?hide_repo_select=true\u0026repo=81770291"},"popovers":{"rename":null,"renamedParentRepo":null},"commitCount":"2,556","overviewFiles":[{"displayName":"README.md","repoName":"MessagePack-CSharp","refName":"master","path":"README.md","preferredFileType":"readme","tabName":"README","richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMessagePack for C# (.NET Framework, .NET 6, Unity, Xamarin)\u003c/h1\u003e\u003ca id=\"user-content-messagepack-for-c-net-framework-net-6-unity-xamarin\" class=\"anchor\" aria-label=\"Permalink: MessagePack for C# (.NET Framework, .NET 6, Unity, Xamarin)\" href=\"#messagepack-for-c-net-framework-net-6-unity-xamarin\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://www.nuget.org/packages/messagepack\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/09082ebaa79a847bd8269a3d1fcbd9f6bc7fbbbd91357d2729993c69be57e220/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f762f4d6573736167655061636b2e737667\" alt=\"NuGet\" data-canonical-src=\"https://img.shields.io/nuget/v/MessagePack.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.nuget.org/packages/messagepack\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/22806bdc8d828044711400828521acd4979792542cd3c366f135881bbde0882f/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f767072652f4d6573736167655061636b2e737667\" alt=\"NuGet\" data-canonical-src=\"https://img.shields.io/nuget/vpre/MessagePack.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/MessagePack-CSharp/MessagePack-CSharp/releases\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/7b9b29342c6578c18d13bc11879cdd4834eca5ac58aad8f8450bea327fd61509/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e65756563632f4d6573736167655061636b2d4353686172702e737667\" alt=\"Releases\" data-canonical-src=\"https://img.shields.io/github/release/neuecc/MessagePack-CSharp.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://gitter.im/MessagePack-CSharp/Lobby?utm_source=badge\u0026amp;utm_medium=badge\u0026amp;utm_campaign=pr-badge\u0026amp;utm_content=badge\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/3315156f6522eb055b3bf1711e139587acfc9d37e5a4f46c21cf2722305db534/68747470733a2f2f6261646765732e6769747465722e696d2f4d6573736167655061636b2d4353686172702f4c6f6262792e737667\" alt=\"Join the chat at https://gitter.im/MessagePack-CSharp/Lobby\" data-canonical-src=\"https://badges.gitter.im/MessagePack-CSharp/Lobby.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://dev.azure.com/ils0086/MessagePack-CSharp/_build/latest?definitionId=2\u0026amp;branchName=master\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/b5d651da8e13240e117223ba6806b31a774b5d8e06e33e73ea3c5e6c1991270d/68747470733a2f2f6465762e617a7572652e636f6d2f696c73303038362f4d6573736167655061636b2d4353686172702f5f617069732f6275696c642f7374617475732f4d6573736167655061636b2d4353686172702d43493f6272616e63684e616d653d6d6173746572\" alt=\"Build Status\" data-canonical-src=\"https://dev.azure.com/ils0086/MessagePack-CSharp/_apis/build/status/MessagePack-CSharp-CI?branchName=master\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe extremely fast \u003ca href=\"http://msgpack.org/\" rel=\"nofollow\"\u003eMessagePack\u003c/a\u003e serializer for C#.\nIt is 10x faster than \u003ca href=\"https://github.com/msgpack/msgpack-cli\"\u003eMsgPack-Cli\u003c/a\u003e and outperforms other C# serializers. MessagePack for C# also ships with built-in support for LZ4 compression - an extremely fast compression algorithm. Performance is important, particularly in applications like games, distributed computing, microservices, or data caches.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://cloud.githubusercontent.com/assets/46207/23835716/89c8ab08-07af-11e7-9183-9e9415bdc87f.png\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/46207/23835716/89c8ab08-07af-11e7-9183-9e9415bdc87f.png\" alt=\"Perf comparison graph\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMessagePack has a compact binary size and a full set of general purpose expressive data types. Please have a look at the \u003ca href=\"#comparison\"\u003ecomparison with JSON, protobuf, ZeroFormatter section\u003c/a\u003e and learn \u003ca href=\"#performance\"\u003ewhy MessagePack C# is the fastest\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTable of Contents\u003c/h2\u003e\u003ca id=\"user-content-table-of-contents\" class=\"anchor\" aria-label=\"Permalink: Table of Contents\" href=\"#table-of-contents\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#nuget-packages\"\u003eNuGet packages\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#unity\"\u003eUnity\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#migration-notes-from-v1x\"\u003eMigration notes from v1.x\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#analyzer\"\u003eAnalyzer\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#built-in-supported-types\"\u003eBuilt-in supported types\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#object-serialization\"\u003eObject Serialization\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#datacontract-compatibility\"\u003eDataContract compatibility\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#serializing-readonlyimmutable-object-members--serializationconstructor\"\u003eSerializing readonly/immutable object members (SerializationConstructor)\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#serialization-callback\"\u003eSerialization Callback\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#union\"\u003eUnion\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#dynamic-untyped-deserialization\"\u003eDynamic (Untyped) Deserialization\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#object-type-serialization\"\u003eObject Type Serialization\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#typeless\"\u003eTypeless\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#security\"\u003eSecurity\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#performance\"\u003ePerformance\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#deserialization-performance-for-different-options\"\u003eDeserialization Performance for different options\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#string-interning\"\u003eString interning\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#lz4-compression\"\u003eLZ4 Compression\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#attributions\"\u003eAttributions\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#comparison-with-protobuf-json-zeroformatter\"\u003eComparison with protobuf, JSON, ZeroFormatter\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#hints-to-achieve-maximum-performance-when-using-messagepack-for-c\"\u003eHints to achieve maximum performance when using MessagePack for C#\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#use-indexed-keys-instead-of-string-keys-contractless\"\u003eUse indexed keys instead of string keys (Contractless)\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#create-own-custom-composite-resolver\"\u003eCreate own custom composite resolver\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#use-native-resolvers\"\u003eUse native resolvers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#be-careful-when-copying-buffers\"\u003eBe careful when copying buffers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#choosing-compression\"\u003eChoosing compression\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#extensions\"\u003eExtensions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#experimental-features\"\u003eExperimental Features\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#high-level-api-messagepackserializer\"\u003eHigh-Level API (\u003ccode\u003eMessagePackSerializer\u003c/code\u003e)\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#multiple-messagepack-structures-on-a-single-stream\"\u003eMultiple MessagePack structures on a single \u003ccode\u003eStream\u003c/code\u003e\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#low-level-api-imessagepackformattert\"\u003eLow-Level API (\u003ccode\u003eIMessagePackFormatter\u0026lt;T\u0026gt;\u003c/code\u003e)\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#primitive-api-messagepackwriter-messagepackreader\"\u003ePrimitive API (\u003ccode\u003eMessagePackWriter\u003c/code\u003e, \u003ccode\u003eMessagePackReader\u003c/code\u003e)\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#messagepackreader\"\u003e\u003ccode\u003eMessagePackReader\u003c/code\u003e\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#messagepackwriter\"\u003e\u003ccode\u003eMessagePackWriter\u003c/code\u003e\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#main-extension-point-iformatterresolver\"\u003eMain Extension Point (\u003ccode\u003eIFormatterResolver\u003c/code\u003e)\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#messagepackformatterattribute\"\u003eMessagePackFormatterAttribute\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#ignoreformatter\"\u003eIgnoreFormatter\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#reserved-extension-types\"\u003eReserved Extension Types\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#unity-support\"\u003eUnity support\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#aot-code-generation-support-for-unityxamarin\"\u003eAOT Code Generation (support for Unity/Xamarin)\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#rpc\"\u003eRPC\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#magiconion\"\u003eMagicOnion\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#streamjsonrpc\"\u003eStreamJsonRpc\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#how-to-build\"\u003eHow to build\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#author-info\"\u003eAuthor Info\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#coc\"\u003eCode of Conduct \u0026amp; .NET Foundation notice\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eInstallation\u003c/h2\u003e\u003ca id=\"user-content-installation\" class=\"anchor\" aria-label=\"Permalink: Installation\" href=\"#installation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis library is distributed via NuGet. Special \u003ca href=\"#unity\"\u003eUnity support\u003c/a\u003e is available, too.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWe target .NET Standard 2.0 with special optimizations for .NET 6+, making it compatible with most reasonably recent .NET runtimes such as Core 2.0 and later, Framework 4.6.1 and later, Mono 5.4 and later and Unity 2018.3 and later.\nThe library code is pure C# (with Just-In-Time IL code generation on some platforms).\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eNuGet packages\u003c/h3\u003e\u003ca id=\"user-content-nuget-packages\" class=\"anchor\" aria-label=\"Permalink: NuGet packages\" href=\"#nuget-packages\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo install with NuGet, just install the \u003ccode\u003eMessagePack\u003c/code\u003e package:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-powershell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Install-Package MessagePack\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003eInstall-Package\u003c/span\u003e MessagePack\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eInstall the optional C# \u003ca href=\"/MessagePack-CSharp/MessagePack-CSharp/blob/master/doc/analyzers/index.md\"\u003eanalyzers\u003c/a\u003e package to get warnings about coding mistakes and automatic fix suggestions to save you time:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-powershell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Install-Package MessagePackAnalyzer\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003eInstall-Package\u003c/span\u003e MessagePackAnalyzer\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere are also a range of official and third party Extension Packages available (learn more in our \u003ca href=\"#extensions\"\u003eextensions section\u003c/a\u003e):\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-powershell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Install-Package MessagePack.ReactiveProperty\nInstall-Package MessagePack.UnityShims\nInstall-Package MessagePack.AspNetCoreMvcFormatter\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003eInstall-Package\u003c/span\u003e MessagePack.ReactiveProperty\n\u003cspan class=\"pl-c1\"\u003eInstall-Package\u003c/span\u003e MessagePack.UnityShims\n\u003cspan class=\"pl-c1\"\u003eInstall-Package\u003c/span\u003e MessagePack.AspNetCoreMvcFormatter\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUnity\u003c/h3\u003e\u003ca id=\"user-content-unity\" class=\"anchor\" aria-label=\"Permalink: Unity\" href=\"#unity\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFor Unity projects, the \u003ca href=\"https://github.com/MessagePack-CSharp/MessagePack-CSharp/releases\"\u003eReleases\u003c/a\u003e page provides downloadable \u003ccode\u003e.unitypackage\u003c/code\u003e files. When using in Unity IL2CPP or Xamarin AOT environments, please carefully read the \u003ca href=\"#aot\"\u003epre-code generation section\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMigration notes from v1.x\u003c/h3\u003e\u003ca id=\"user-content-migration-notes-from-v1x\" class=\"anchor\" aria-label=\"Permalink: Migration notes from v1.x\" href=\"#migration-notes-from-v1x\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you were using MessagePack for C# v1.x, check out the \u003ca href=\"/MessagePack-CSharp/MessagePack-CSharp/blob/master/doc/migration.md\"\u003e\"How to update to our new v2.x version\"\u003c/a\u003e document.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eQuick Start\u003c/h2\u003e\u003ca id=\"user-content-quick-start\" class=\"anchor\" aria-label=\"Permalink: Quick Start\" href=\"#quick-start\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eDefine the struct or class to be serialized and annotate it with a \u003ccode\u003e[MessagePackObject]\u003c/code\u003e attribute.\nAnnotate members whose values should be serialized (fields as well as properties) with \u003ccode\u003e[Key]\u003c/code\u003e attributes.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackObject]\npublic class MyClass\n{\n // Key attributes take a serialization index (or string name)\n // The values must be unique and versioning has to be considered as well.\n // Keys are described in later sections in more detail.\n [Key(0)]\n public int Age { get; set; }\n\n [Key(1)]\n public string FirstName { get; set; }\n\n [Key(2)]\n public string LastName { get; set; }\n\n // All fields or properties that should not be serialized must be annotated with [IgnoreMember].\n [IgnoreMember]\n public string FullName { get { return FirstName + LastName; } }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMyClass\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// Key attributes take a serialization index (or string name)\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// The values must be unique and versioning has to be considered as well.\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// Keys are described in later sections in more detail.\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eAge\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFirstName\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eLastName\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// All fields or properties that should not be serialized must be annotated with [IgnoreMember].\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eIgnoreMember\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFullName\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFirstName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e+\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eLastName\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eCall \u003ccode\u003eMessagePackSerializer.Serialize\u0026lt;T\u0026gt;/Deserialize\u0026lt;T\u0026gt;\u003c/code\u003e to serialize/deserialize your object instance.\nYou can use the \u003ccode\u003eConvertToJson\u003c/code\u003e method to get a human readable representation of any MessagePack binary blob.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"class Program\n{\n static void Main(string[] args)\n {\n var mc = new MyClass\n {\n Age = 99,\n FirstName = \u0026quot;hoge\u0026quot;,\n LastName = \u0026quot;huga\u0026quot;,\n };\n\n // Call Serialize/Deserialize, that's all.\n byte[] bytes = MessagePackSerializer.Serialize(mc);\n MyClass mc2 = MessagePackSerializer.Deserialize\u0026lt;MyClass\u0026gt;(bytes);\n\n // You can dump MessagePack binary blobs to human readable json.\n // Using indexed keys (as opposed to string keys) will serialize to MessagePack arrays,\n // hence property names are not available.\n // [99,\u0026quot;hoge\u0026quot;,\u0026quot;huga\u0026quot;]\n var json = MessagePackSerializer.ConvertToJson(bytes);\n Console.WriteLine(json);\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eProgram\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eMain\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eargs\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003emc\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e MyClass\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eAge\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e99\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eFirstName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003ehoge\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eLastName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003ehuga\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// Call Serialize/Deserialize, that's all.\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003ebyte\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ebytes\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003emc\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003eMyClass\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003emc2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eMyClass\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebytes\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// You can dump MessagePack binary blobs to human readable json.\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// Using indexed keys (as opposed to string keys) will serialize to MessagePack arrays,\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// hence property names are not available.\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// [99,\"hoge\",\"huga\"]\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ejson\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eConvertToJson\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebytes\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ejson\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBy default, a \u003ccode\u003eMessagePackObject\u003c/code\u003e annotation is required. This can be made optional; see the \u003ca href=\"#object-serialization\"\u003eObject Serialization section\u003c/a\u003e and the \u003ca href=\"#resolvers\"\u003eFormatter Resolver section\u003c/a\u003e for details.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eAnalyzer\u003c/h2\u003e\u003ca id=\"user-content-analyzer\" class=\"anchor\" aria-label=\"Permalink: Analyzer\" href=\"#analyzer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe MessagePackAnalyzer package aids with:\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eAutomating definitions for your serializable objects.\u003c/li\u003e\n\u003cli\u003eProduces compiler warnings upon incorrect attribute use, member accessibility, and more.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://cloud.githubusercontent.com/assets/46207/23837445/ce734eae-07cb-11e7-9758-d69f0f095bc1.gif\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/46207/23837445/ce734eae-07cb-11e7-9758-d69f0f095bc1.gif\" alt=\"analyzergif\" data-animated-image=\"\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you want to allow a specific custom type (for example, when registering a custom type), put \u003ccode\u003eMessagePackAnalyzer.json\u003c/code\u003e at the project root and change the Build Action to \u003ccode\u003eAdditionalFiles\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://cloud.githubusercontent.com/assets/46207/23837427/8a8d507c-07cb-11e7-9277-5a566eb0bfde.png\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/46207/23837427/8a8d507c-07cb-11e7-9277-5a566eb0bfde.png\" alt=\"image\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAn example \u003ccode\u003eMessagePackAnalyzer.json\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-json notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[ \u0026quot;MyNamespace.FooClass\u0026quot;, \u0026quot;MyNameSpace.BarStruct\u0026quot; ]\"\u003e\u003cpre\u003e[ \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eMyNamespace.FooClass\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eMyNameSpace.BarStruct\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e ]\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBuilt-in supported types\u003c/h2\u003e\u003ca id=\"user-content-built-in-supported-types\" class=\"anchor\" aria-label=\"Permalink: Built-in supported types\" href=\"#built-in-supported-types\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThese types can serialize by default:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003ePrimitives (\u003ccode\u003eint\u003c/code\u003e, \u003ccode\u003estring\u003c/code\u003e, etc...), \u003ccode\u003eEnum\u003c/code\u003es, \u003ccode\u003eNullable\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eLazy\u0026lt;\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eTimeSpan\u003c/code\u003e, \u003ccode\u003eDateTime\u003c/code\u003e, \u003ccode\u003eDateTimeOffset\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eGuid\u003c/code\u003e, \u003ccode\u003eUri\u003c/code\u003e, \u003ccode\u003eVersion\u003c/code\u003e, \u003ccode\u003eStringBuilder\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eBigInteger\u003c/code\u003e, \u003ccode\u003eComplex\u003c/code\u003e, \u003ccode\u003eHalf\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eArray[]\u003c/code\u003e, \u003ccode\u003eArray[,]\u003c/code\u003e, \u003ccode\u003eArray[,,]\u003c/code\u003e, \u003ccode\u003eArray[,,,]\u003c/code\u003e, \u003ccode\u003eArraySegment\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eBitArray\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eKeyValuePair\u0026lt;,\u0026gt;\u003c/code\u003e, \u003ccode\u003eTuple\u0026lt;,...\u0026gt;\u003c/code\u003e, \u003ccode\u003eValueTuple\u0026lt;,...\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eArrayList\u003c/code\u003e, \u003ccode\u003eHashtable\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eList\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eLinkedList\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eQueue\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eStack\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eHashSet\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eReadOnlyCollection\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eSortedList\u0026lt;,\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eIList\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eICollection\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eIEnumerable\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eIReadOnlyCollection\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eIReadOnlyList\u0026lt;\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eDictionary\u0026lt;,\u0026gt;\u003c/code\u003e, \u003ccode\u003eIDictionary\u0026lt;,\u0026gt;\u003c/code\u003e, \u003ccode\u003eSortedDictionary\u0026lt;,\u0026gt;\u003c/code\u003e, \u003ccode\u003eILookup\u0026lt;,\u0026gt;\u003c/code\u003e, \u003ccode\u003eIGrouping\u0026lt;,\u0026gt;\u003c/code\u003e, \u003ccode\u003eReadOnlyDictionary\u0026lt;,\u0026gt;\u003c/code\u003e, \u003ccode\u003eIReadOnlyDictionary\u0026lt;,\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eObservableCollection\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eReadOnlyObservableCollection\u0026lt;\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eISet\u0026lt;\u0026gt;\u003c/code\u003e,\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eConcurrentBag\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eConcurrentQueue\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eConcurrentStack\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eConcurrentDictionary\u0026lt;,\u0026gt;\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eImmutable collections (\u003ccode\u003eImmutableList\u0026lt;\u0026gt;\u003c/code\u003e, etc)\u003c/li\u003e\n\u003cli\u003eCustom implementations of \u003ccode\u003eICollection\u0026lt;\u0026gt;\u003c/code\u003e or \u003ccode\u003eIDictionary\u0026lt;,\u0026gt;\u003c/code\u003e with a parameterless constructor\u003c/li\u003e\n\u003cli\u003eCustom implementations of \u003ccode\u003eIList\u003c/code\u003e or \u003ccode\u003eIDictionary\u003c/code\u003e with a parameterless constructor\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eYou can add support for custom types, and there are some official/third-party extension packages for:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eReactiveProperty\u003c/li\u003e\n\u003cli\u003efor Unity (\u003ccode\u003eVector3\u003c/code\u003e, \u003ccode\u003eQuaternion\u003c/code\u003e, etc...)\u003c/li\u003e\n\u003cli\u003eF# (Record, FsList, Discriminated Unions, etc...)\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003ePlease see the \u003ca href=\"#extensions\"\u003eextensions section\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eMessagePack.Nil\u003c/code\u003e is the built-in type representing null/void in MessagePack for C#.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eObject Serialization\u003c/h2\u003e\u003ca id=\"user-content-object-serialization\" class=\"anchor\" aria-label=\"Permalink: Object Serialization\" href=\"#object-serialization\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# can serialize your own public \u003ccode\u003eclass\u003c/code\u003e or \u003ccode\u003estruct\u003c/code\u003e types. By default, serializable types must be annotated with the \u003ccode\u003e[MessagePackObject]\u003c/code\u003e attribute and members with the \u003ccode\u003e[Key]\u003c/code\u003e attribute. Keys can be either indexes (\u003ccode\u003eint\u003c/code\u003e) or arbitrary strings. If all keys are indexes, arrays are used for serialization, which offers advantages in performance and binary size. Otherwise, MessagePack maps (dictionaries) will be used.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you use \u003ccode\u003e[MessagePackObject(keyAsPropertyName: true)]\u003c/code\u003e, then members do not require explicit \u003ccode\u003eKey\u003c/code\u003e attributes, but string keys will be used.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackObject]\npublic class Sample1\n{\n [Key(0)]\n public int Foo { get; set; }\n [Key(1)]\n public int Bar { get; set; }\n}\n\n[MessagePackObject]\npublic class Sample2\n{\n [Key(\u0026quot;foo\u0026quot;)]\n public int Foo { get; set; }\n [Key(\u0026quot;bar\u0026quot;)]\n public int Bar { get; set; }\n}\n\n[MessagePackObject(keyAsPropertyName: true)]\npublic class Sample3\n{\n // No need for a Key attribute\n public int Foo { get; set; }\n\n // If want to ignore a public member, you can use the IgnoreMember attribute\n [IgnoreMember]\n public int Bar { get; set; }\n}\n\n// [10,20]\nConsole.WriteLine(MessagePackSerializer.SerializeToJson(new Sample1 { Foo = 10, Bar = 20 }));\n\n// {\u0026quot;foo\u0026quot;:10,\u0026quot;bar\u0026quot;:20}\nConsole.WriteLine(MessagePackSerializer.SerializeToJson(new Sample2 { Foo = 10, Bar = 20 }));\n\n// {\u0026quot;Foo\u0026quot;:10}\nConsole.WriteLine(MessagePackSerializer.SerializeToJson(new Sample3 { Foo = 10, Bar = 20 }));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSample1\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFoo\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eBar\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSample2\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003efoo\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFoo\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003ebar\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eBar\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ekeyAsPropertyName\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSample3\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// No need for a Key attribute\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFoo\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// If want to ignore a public member, you can use the IgnoreMember attribute\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eIgnoreMember\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eBar\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// [10,20]\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSerializeToJson\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003enew Sample1 \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e Foo \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e10\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e Bar \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e20\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// {\"foo\":10,\"bar\":20}\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSerializeToJson\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003enew Sample2 \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e Foo \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e10\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e Bar \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e20\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// {\"Foo\":10}\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSerializeToJson\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003enew Sample3 \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e Foo \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e10\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e Bar \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e20\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAll public instance members (fields as well as properties) will be serialized. If you want to ignore certain public members, annotate the member with a \u003ccode\u003e[IgnoreMember]\u003c/code\u003e attribute.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ePlease note that any serializable struct or class must have public accessibility; private and internal structs and classes cannot be serialized!\nThe default of requiring \u003ccode\u003eMessagePackObject\u003c/code\u003e annotations is meant to enforce explicitness and therefore may help write more robust code.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eShould you use an indexed (\u003ccode\u003eint\u003c/code\u003e) key or a string key?\nWe recommend using indexed keys for faster serialization and a more compact binary representation than string keys.\nHowever, the additional information in the strings of string keys can be quite useful when debugging.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWhen classes change or are extended, be careful about versioning. \u003ccode\u003eMessagePackSerializer\u003c/code\u003e will initialize members to their \u003ccode\u003edefault\u003c/code\u003e value if a key does not exist in the serialized binary blob, meaning members using reference types can be initialized to \u003ccode\u003enull\u003c/code\u003e.\nIf you use indexed (\u003ccode\u003eint\u003c/code\u003e) keys, the keys should start at 0 and should be sequential. If a later version stops using certain members, you should keep the obsolete members (C# provides an \u003ccode\u003eObsolete\u003c/code\u003e attribute to annotate such members) until all other clients had a chance to update and remove their uses of these members as well. Also, when the values of indexed keys \"jump\" a lot, leaving gaps in the sequence, it will negatively affect the binary size, as \u003ccode\u003enull\u003c/code\u003e placeholders will be inserted into the resulting arrays. However, you shouldn't reuse indexes of removed members to avoid compatibility issues between clients or when trying to deserialize legacy blobs.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eExample of index gaps and resulting placeholders:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackObject]\npublic class IntKeySample\n{\n [Key(3)]\n public int A { get; set; }\n [Key(10)]\n public int B { get; set; }\n}\n\n// [null,null,null,0,null,null,null,null,null,null,0]\nConsole.WriteLine(MessagePackSerializer.SerializeToJson(new IntKeySample()));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIntKeySample\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e3\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eA\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e10\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eB\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// [null,null,null,0,null,null,null,null,null,null,0]\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSerializeToJson\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003enew IntKeySample\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you do not want to explicitly annotate with the \u003ccode\u003eMessagePackObject\u003c/code\u003e/\u003ccode\u003eKey\u003c/code\u003e attributes and instead want to use MessagePack for C# more like e.g. \u003ca href=\"https://github.com/JamesNK/Newtonsoft.Json\"\u003eJson.NET\u003c/a\u003e, you can make use of the contractless resolver.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public class ContractlessSample\n{\n public int MyProperty1 { get; set; }\n public int MyProperty2 { get; set; }\n}\n\nvar data = new ContractlessSample { MyProperty1 = 99, MyProperty2 = 9999 };\nvar bin = MessagePackSerializer.Serialize(\n data,\n MessagePack.Resolvers.ContractlessStandardResolver.Options);\n\n// {\u0026quot;MyProperty1\u0026quot;:99,\u0026quot;MyProperty2\u0026quot;:9999}\nConsole.WriteLine(MessagePackSerializer.ConvertToJson(bin));\n\n// You can also set ContractlessStandardResolver as the default.\n// (Global state; Not recommended when writing library code)\nMessagePackSerializer.DefaultOptions = MessagePack.Resolvers.ContractlessStandardResolver.Options;\n\n// Now serializable...\nvar bin2 = MessagePackSerializer.Serialize(data);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eContractlessSample\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eMyProperty1\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eMyProperty2\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003edata\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e ContractlessSample \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eMyProperty1\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e99\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eMyProperty2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e9999\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ebin\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n data\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eContractlessStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOptions\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// {\"MyProperty1\":99,\"MyProperty2\":9999}\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eConvertToJson\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebin\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// You can also set ContractlessStandardResolver as the default.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e// (Global state; Not recommended when writing library code)\u003c/span\u003e\nMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDefaultOptions\u003cspan class=\"pl-s1\"\u003e\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eContractlessStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOptions\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Now serializable...\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ebin2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003edata\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you want to serialize private members as well, you can use one of the \u003ccode\u003e*AllowPrivate\u003c/code\u003e resolvers.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackObject]\npublic class PrivateSample\n{\n [Key(0)]\n int x;\n\n public void SetX(int v)\n {\n x = v;\n }\n\n public int GetX()\n {\n return x;\n }\n}\n\nvar data = new PrivateSample();\ndata.SetX(9999);\n\n// You can choose either StandardResolverAllowPrivate\n// or ContractlessStandardResolverAllowPrivate\nvar bin = MessagePackSerializer.Serialize(\n data,\n MessagePack.Resolvers.DynamicObjectResolverAllowPrivate.Options);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePrivateSample\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eSetX\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ev\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ev\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eGetX\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003edata\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e PrivateSample\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\ndata\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSetX\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e9999\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// You can choose either StandardResolverAllowPrivate\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e// or ContractlessStandardResolverAllowPrivate\u003c/span\u003e\nvar bin \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSerialize\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n data\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDynamicObjectResolverAllowPrivate\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOptions\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you want to use MessagePack for C# more like a BinaryFormatter with a typeless serialization API, use the typeless resolver and helpers. Please consult the \u003ca href=\"#typeless\"\u003eTypeless section\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eResolvers are the way to add specialized support for custom types to MessagePack for C#. Please refer to the \u003ca href=\"#resolvers\"\u003eExtension point section\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDataContract compatibility\u003c/h2\u003e\u003ca id=\"user-content-datacontract-compatibility\" class=\"anchor\" aria-label=\"Permalink: DataContract compatibility\" href=\"#datacontract-compatibility\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou can use \u003ccode\u003e[DataContract]\u003c/code\u003e annotations instead of \u003ccode\u003e[MessagePackObject]\u003c/code\u003e ones. If type is annotated with \u003ccode\u003eDataContract\u003c/code\u003e, you can use \u003ccode\u003e[DataMember]\u003c/code\u003e annotations instead of \u003ccode\u003e[Key]\u003c/code\u003e ones and \u003ccode\u003e[IgnoreDataMember]\u003c/code\u003e instead of \u003ccode\u003e[IgnoreMember]\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThen \u003ccode\u003e[DataMember(Order = int)]\u003c/code\u003e will behave the same as \u003ccode\u003e[Key(int)]\u003c/code\u003e, \u003ccode\u003e[DataMember(Name = string)]\u003c/code\u003e the same as \u003ccode\u003e[Key(string)]\u003c/code\u003e, and \u003ccode\u003e[DataMember]\u003c/code\u003e the same as \u003ccode\u003e[Key(nameof(member name)]\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eUsing \u003ccode\u003eDataContract\u003c/code\u003e, e.g. in shared libraries, makes your classes/structs independent from MessagePack for C# serialization. However, it is not supported by the analyzers nor in code generation by the \u003ccode\u003empc\u003c/code\u003e tool. Also, features like \u003ccode\u003eUnionAttribute\u003c/code\u003e, \u003ccode\u003eMessagePackFormatter\u003c/code\u003e, \u003ccode\u003eSerializationConstructor\u003c/code\u003e, etc can not be used. Due to this, we recommend that you use the specific MessagePack for C# annotations when possible.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSerializing readonly/immutable object members (SerializationConstructor)\u003c/h2\u003e\u003ca id=\"user-content-serializing-readonlyimmutable-object-members--serializationconstructor\" class=\"anchor\" aria-label=\"Permalink: Serializing readonly/immutable object members (SerializationConstructor)\" href=\"#serializing-readonlyimmutable-object-members--serializationconstructor\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# supports serialization of readonly/immutable objects/members. For example, this struct can be serialized and deserialized.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackObject]\npublic struct Point\n{\n [Key(0)]\n public readonly int X;\n [Key(1)]\n public readonly int Y;\n\n public Point(int x, int y)\n {\n this.X = x;\n this.Y = y;\n }\n}\n\nvar data = new Point(99, 9999);\nvar bin = MessagePackSerializer.Serialize(data);\n\n// Okay to deserialize immutable object\nvar point = MessagePackSerializer.Deserialize\u0026lt;Point\u0026gt;(bin);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePoint\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereadonly\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eX\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereadonly\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eY\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-v\"\u003ePoint\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ey\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ethis\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eX \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ethis\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eY \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ey\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003edata\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e Point\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e99\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e9999\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ebin\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003edata\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Okay to deserialize immutable object\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003epoint\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003ePoint\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebin\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eMessagePackSerializer\u003c/code\u003e will choose the constructor with the best matched argument list, using argument indexes index for index keys, or parameter names for string keys. If it cannot determine an appropriate constructor, a \u003ccode\u003eMessagePackDynamicObjectResolverException: can't find matched constructor parameter\u003c/code\u003e exception will be thrown.\nYou can specify which constructor to use manually with a \u003ccode\u003e[SerializationConstructor]\u003c/code\u003e annotation.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackObject]\npublic struct Point\n{\n [Key(0)]\n public readonly int X;\n [Key(1)]\n public readonly int Y;\n\n [SerializationConstructor]\n public Point(int x)\n {\n this.X = x;\n this.Y = -1;\n }\n\n // If not marked attribute, used this(most matched argument)\n public Point(int x, int y)\n {\n this.X = x;\n this.Y = y;\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePoint\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereadonly\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eX\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereadonly\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eY\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eSerializationConstructor\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-v\"\u003ePoint\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ethis\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eX \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ethis\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eY \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e-\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// If not marked attribute, used this(most matched argument)\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-v\"\u003ePoint\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ey\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ethis\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eX \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ethis\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eY \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ey\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eC# 9 \u003ccode\u003erecord\u003c/code\u003e types\u003c/h3\u003e\u003ca id=\"user-content-c-9-record-types\" class=\"anchor\" aria-label=\"Permalink: C# 9 record types\" href=\"#c-9-record-types\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eC# 9.0 record with primary constructor is similar immutable object, also supports serialize/deserialize.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// use key as property name\n[MessagePackObject(true)]public record Point(int X, int Y);\n\n// use property: to set KeyAttribute\n[MessagePackObject] public record Point([property:Key(0)] int X, [property: Key(1)] int Y);\n\n// Or use explicit properties\n[MessagePackObject]\npublic record Person\n{\n [Key(0)]\n public string FirstName { get; init; }\n\n [Key(1)]\n public string LastName { get; init; }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e// use key as property name\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003erecord\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePoint\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eX\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eY\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// use property: to set KeyAttribute\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003erecord\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePoint\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003eproperty\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eX\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003eproperty\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eY\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Or use explicit properties\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003erecord\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePerson\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFirstName\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einit\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eLastName\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einit\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eC# 9 \u003ccode\u003einit\u003c/code\u003e property setter limitations\u003c/h3\u003e\u003ca id=\"user-content-c-9-init-property-setter-limitations\" class=\"anchor\" aria-label=\"Permalink: C# 9 init property setter limitations\" href=\"#c-9-init-property-setter-limitations\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWhen using \u003ccode\u003einit\u003c/code\u003e property setters in \u003cem\u003egeneric\u003c/em\u003e classes, \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp/issues/1134\" data-hovercard-type=\"issue\" data-hovercard-url=\"/MessagePack-CSharp/MessagePack-CSharp/issues/1134/hovercard\"\u003ea CLR bug\u003c/a\u003e prevents our most efficient code generation from invoking the property setter.\nAs a result, you should avoid using \u003ccode\u003einit\u003c/code\u003e on property setters in generic classes when using the public-only \u003ccode\u003eDynamicObjectResolver\u003c/code\u003e/\u003ccode\u003eStandardResolver\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWhen using the \u003ccode\u003eDynamicObjectResolverAllowPrivate\u003c/code\u003e/\u003ccode\u003eStandardResolverAllowPrivate\u003c/code\u003e resolver the bug does not apply and you may use \u003ccode\u003einit\u003c/code\u003e without restriction.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSerialization Callback\u003c/h2\u003e\u003ca id=\"user-content-serialization-callback\" class=\"anchor\" aria-label=\"Permalink: Serialization Callback\" href=\"#serialization-callback\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eObjects implementing the \u003ccode\u003eIMessagePackSerializationCallbackReceiver\u003c/code\u003e interface will received \u003ccode\u003eOnBeforeSerialize\u003c/code\u003e and \u003ccode\u003eOnAfterDeserialize\u003c/code\u003e calls during serialization/deserialization.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackObject]\npublic class SampleCallback : IMessagePackSerializationCallbackReceiver\n{\n [Key(0)]\n public int Key { get; set; }\n\n public void OnBeforeSerialize()\n {\n Console.WriteLine(\u0026quot;OnBefore\u0026quot;);\n }\n\n public void OnAfterDeserialize()\n {\n Console.WriteLine(\u0026quot;OnAfter\u0026quot;);\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSampleCallback\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackSerializationCallbackReceiver\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eKey\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eOnBeforeSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eOnBefore\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eOnAfterDeserialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eOnAfter\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUnion\u003c/h2\u003e\u003ca id=\"user-content-union\" class=\"anchor\" aria-label=\"Permalink: Union\" href=\"#union\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# supports serializing interface-typed and abstract class-typed objects. It behaves like \u003ccode\u003eXmlInclude\u003c/code\u003e or \u003ccode\u003eProtoInclude\u003c/code\u003e. In MessagePack for C# these are called \u003ccode\u003eUnion\u003c/code\u003e. Only interfaces and abstracts classes are allowed to be annotated with \u003ccode\u003eUnion\u003c/code\u003e attributes. Unique union keys are required.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// Annotate inheritance types\n[MessagePack.Union(0, typeof(FooClass))]\n[MessagePack.Union(1, typeof(BarClass))]\npublic interface IUnionSample\n{\n}\n\n[MessagePackObject]\npublic class FooClass : IUnionSample\n{\n [Key(0)]\n public int XYZ { get; set; }\n}\n\n[MessagePackObject]\npublic class BarClass : IUnionSample\n{\n [Key(0)]\n public string OPQ { get; set; }\n}\n\n// ---\n\nIUnionSample data = new FooClass() { XYZ = 999 };\n\n// Serialize interface-typed object.\nvar bin = MessagePackSerializer.Serialize(data);\n\n// Deserialize again.\nvar reData = MessagePackSerializer.Deserialize\u0026lt;IUnionSample\u0026gt;(bin);\n\n// Use with e.g. type-switching in C# 7.0\nswitch (reData)\n{\n case FooClass x:\n Console.WriteLine(x.XYZ);\n break;\n case BarClass x:\n Console.WriteLine(x.OPQ);\n break;\n default:\n break;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e// Annotate inheritance types\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnion\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eFooClass\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnion\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eBarClass\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIUnionSample\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFooClass\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIUnionSample\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eXYZ\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eBarClass\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIUnionSample\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eOPQ\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// ---\u003c/span\u003e\n\n\u003cspan class=\"pl-smi\"\u003eIUnionSample\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003edata\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e FooClass\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eXYZ\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e999\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Serialize interface-typed object.\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ebin\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003edata\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Deserialize again.\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ereData\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eIUnionSample\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebin\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Use with e.g. type-switching in C# 7.0\u003c/span\u003e\n\u003cspan class=\"pl-v\"\u003eswitch\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ereData\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003ecase\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFooClass\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e\u003c/span\u003e x\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ex\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eXYZ\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ebreak\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003ecase\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eBarClass\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e\u003c/span\u003e x\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ex\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOPQ\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ebreak\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ebreak\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eUnions are internally serialized to two-element arrays.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"IUnionSample data = new BarClass { OPQ = \u0026quot;FooBar\u0026quot; };\n\nvar bin = MessagePackSerializer.Serialize(data);\n\n// Union is serialized to two-length array, [key, object]\n// [1,[\u0026quot;FooBar\u0026quot;]]\nConsole.WriteLine(MessagePackSerializer.ConvertToJson(bin));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eIUnionSample\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003edata\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e BarClass \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eOPQ\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eFooBar\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ebin\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003edata\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Union is serialized to two-length array, [key, object]\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e// [1,[\"FooBar\"]]\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eConvertToJson\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebin\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eUsing \u003ccode\u003eUnion\u003c/code\u003e with abstract classes works the same way.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[Union(0, typeof(SubUnionType1))]\n[Union(1, typeof(SubUnionType2))]\n[MessagePackObject]\npublic abstract class ParentUnionType\n{\n [Key(0)]\n public int MyProperty { get; set; }\n}\n\n[MessagePackObject]\npublic class SubUnionType1 : ParentUnionType\n{\n [Key(1)]\n public int MyProperty1 { get; set; }\n}\n\n[MessagePackObject]\npublic class SubUnionType2 : ParentUnionType\n{\n [Key(1)]\n public int MyProperty2 { get; set; }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eUnion\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eSubUnionType1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eUnion\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eSubUnionType2\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eabstract\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eParentUnionType\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eMyProperty\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSubUnionType1\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eParentUnionType\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eMyProperty1\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSubUnionType2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eParentUnionType\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eMyProperty2\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ePlease be mindful that you cannot reuse the same keys in derived types that are already present in the parent type, as internally a single flat array or map will be used and thus cannot have duplicate indexes/keys.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDynamic (Untyped) Deserialization\u003c/h2\u003e\u003ca id=\"user-content-dynamic-untyped-deserialization\" class=\"anchor\" aria-label=\"Permalink: Dynamic (Untyped) Deserialization\" href=\"#dynamic-untyped-deserialization\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWhen calling \u003ccode\u003eMessagePackSerializer.Deserialize\u0026lt;object\u0026gt;\u003c/code\u003e or \u003ccode\u003eMessagePackSerializer.Deserialize\u0026lt;dynamic\u0026gt;\u003c/code\u003e, any values present in the blob will be converted to primitive values, i.e. \u003ccode\u003ebool\u003c/code\u003e, \u003ccode\u003echar\u003c/code\u003e, \u003ccode\u003esbyte\u003c/code\u003e, \u003ccode\u003ebyte\u003c/code\u003e, \u003ccode\u003eshort\u003c/code\u003e, \u003ccode\u003eint\u003c/code\u003e, \u003ccode\u003elong\u003c/code\u003e, \u003ccode\u003eushort\u003c/code\u003e, \u003ccode\u003euint\u003c/code\u003e, \u003ccode\u003eulong\u003c/code\u003e, \u003ccode\u003efloat\u003c/code\u003e, \u003ccode\u003edouble\u003c/code\u003e, \u003ccode\u003eDateTime\u003c/code\u003e, \u003ccode\u003estring\u003c/code\u003e, \u003ccode\u003ebyte[]\u003c/code\u003e, \u003ccode\u003eobject[]\u003c/code\u003e, \u003ccode\u003eIDictionary\u0026lt;object, object\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// Sample blob.\nvar model = new DynamicModel { Name = \u0026quot;foobar\u0026quot;, Items = new[] { 1, 10, 100, 1000 } };\nvar blob = MessagePackSerializer.Serialize(model, ContractlessStandardResolver.Options);\n\n// Dynamic (\u0026quot;untyped\u0026quot;)\nvar dynamicModel = MessagePackSerializer.Deserialize\u0026lt;dynamic\u0026gt;(blob, ContractlessStandardResolver.Options);\n\n// You can access the data using array/dictionary indexers, as shown above\nConsole.WriteLine(dynamicModel[\u0026quot;Name\u0026quot;]); // foobar\nConsole.WriteLine(dynamicModel[\u0026quot;Items\u0026quot;][2]); // 100\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e// Sample blob.\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003emodel\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e DynamicModel \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003efoobar\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eItems\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e10\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e100\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e1000\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eblob\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003emodel\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e ContractlessStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOptions\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Dynamic (\"untyped\")\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003edynamicModel\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003edynamic\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eblob\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e ContractlessStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOptions\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// You can access the data using array/dictionary indexers, as shown above\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003edynamicModel\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eName\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e// foobar\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003edynamicModel\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eItems\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e// 100\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eExploring object trees using the dictionary indexer syntax is the fastest option for untyped deserialization, but it is tedious to read and write.\nWhere performance is not as important as code readability, consider deserializing with \u003ca href=\"/MessagePack-CSharp/MessagePack-CSharp/blob/master/doc/ExpandoObject.md\"\u003eExpandoObject\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eObject Type Serialization\u003c/h2\u003e\u003ca id=\"user-content-object-type-serialization\" class=\"anchor\" aria-label=\"Permalink: Object Type Serialization\" href=\"#object-type-serialization\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eStandardResolver\u003c/code\u003e and \u003ccode\u003eContractlessStandardResolver\u003c/code\u003e can serialize \u003ccode\u003eobject\u003c/code\u003e/anonymous typed objects.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"var objects = new object[] { 1, \u0026quot;aaa\u0026quot;, new ObjectFieldType { Anything = 9999 } };\nvar bin = MessagePackSerializer.Serialize(objects);\n\n// [1,\u0026quot;aaa\u0026quot;,[9999]]\nConsole.WriteLine(MessagePackSerializer.ConvertToJson(bin));\n\n// Support anonymous Type Serialize\nvar anonType = new { Foo = 100, Bar = \u0026quot;foobar\u0026quot; };\nvar bin2 = MessagePackSerializer.Serialize(anonType, MessagePack.Resolvers.ContractlessStandardResolver.Options);\n\n// {\u0026quot;Foo\u0026quot;:100,\u0026quot;Bar\u0026quot;:\u0026quot;foobar\u0026quot;}\nConsole.WriteLine(MessagePackSerializer.ConvertToJson(bin2));\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eobjects\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eobject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eaaa\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e ObjectFieldType \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eAnything\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e9999\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ebin\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eobjects\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// [1,\"aaa\",[9999]]\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eConvertToJson\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebin\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Support anonymous Type Serialize\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eanonType\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e Foo \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e100\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e Bar \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003efoobar\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ebin2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eanonType\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eContractlessStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOptions\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// {\"Foo\":100,\"Bar\":\"foobar\"}\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eConvertToJson\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebin2\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003eUnity supports is limited.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp dir=\"auto\"\u003eWhen deserializing, the behavior will be the same as Dynamic (Untyped) Deserialization.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTypeless\u003c/h2\u003e\u003ca id=\"user-content-typeless\" class=\"anchor\" aria-label=\"Permalink: Typeless\" href=\"#typeless\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe typeless API is similar to \u003ccode\u003eBinaryFormatter\u003c/code\u003e, as it will embed type information into the blobs, so no types need to be specified explicitly when calling the API.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"object mc = new Sandbox.MyClass()\n{\n Age = 10,\n FirstName = \u0026quot;hoge\u0026quot;,\n LastName = \u0026quot;huga\u0026quot;\n};\n\n// Serialize with the typeless API\nvar blob = MessagePackSerializer.Typeless.Serialize(mc);\n\n// Blob has embedded type-assembly information.\n// [\u0026quot;Sandbox.MyClass, Sandbox\u0026quot;,10,\u0026quot;hoge\u0026quot;,\u0026quot;huga\u0026quot;]\nConsole.WriteLine(MessagePackSerializer.ConvertToJson(bin));\n\n// You can deserialize to MyClass again with the typeless API\n// Note that no type has to be specified explicitly in the Deserialize call\n// as type information is embedded in the binary blob\nvar objModel = MessagePackSerializer.Typeless.Deserialize(bin) as MyClass;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eobject\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003emc\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e Sandbox\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eMyClass\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eAge\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e10\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eFirstName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003ehoge\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eLastName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003ehuga\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Serialize with the typeless API\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eblob\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eTypeless\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003emc\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Blob has embedded type-assembly information.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e// [\"Sandbox.MyClass, Sandbox\",10,\"hoge\",\"huga\"]\u003c/span\u003e\nConsole\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteLine\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eConvertToJson\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebin\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// You can deserialize to MyClass again with the typeless API\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e// Note that no type has to be specified explicitly in the Deserialize call\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e// as type information is embedded in the binary blob\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eobjModel\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eTypeless\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ebin\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e MyClass\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eType information is represented by the MessagePack \u003ccode\u003eext\u003c/code\u003e format, type code \u003ccode\u003e100\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eMessagePackSerializer.Typeless\u003c/code\u003e is a shortcut of \u003ccode\u003eSerialize/Deserialize\u0026lt;object\u0026gt;(TypelessContractlessStandardResolver.Instance)\u003c/code\u003e.\nIf you want to configure it as the default resolver, you can use \u003ccode\u003eMessagePackSerializer.Typeless.RegisterDefaultResolver\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eTypelessFormatter\u003c/code\u003e can used standalone or combined with other resolvers.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// Replaced `object` uses the typeless resolver\nvar resolver = MessagePack.Resolvers.CompositeResolver.Create(\n new[] { MessagePack.Formatters.TypelessFormatter.Instance },\n new[] { MessagePack.Resolvers.StandardResolver.Instance });\n\npublic class Foo\n{\n // use Typeless(this field only)\n [MessagePackFormatter(typeof(TypelessFormatter))]\n public object Bar;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e// Replaced `object` uses the typeless resolver\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresolver\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eCompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eCreate\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eFormatters\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eTypelessFormatter\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFoo\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// use Typeless(this field only)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackFormatter\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eTypelessFormatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eobject\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eBar\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf a type's name is changed later, you can no longer deserialize old blobs. But you can specify a fallback name in such cases, providing a \u003ccode\u003eTypelessFormatter.BindToType\u003c/code\u003e function of your own.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"MessagePack.Formatters.TypelessFormatter.BindToType = typeName =\u0026gt;\n{\n if (typeName.StartsWith(\u0026quot;SomeNamespace\u0026quot;))\n {\n typeName = typeName.Replace(\u0026quot;SomeNamespace\u0026quot;, \u0026quot;AnotherNamespace\u0026quot;);\n }\n\n return Type.GetType(typeName, false);\n};\"\u003e\u003cpre\u003eMessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eFormatters\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eTypelessFormatter\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eBindToType \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003etypeName \u003cspan class=\"pl-c1\"\u003e=\u0026gt;\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003etypeName\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eStartsWith\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eSomeNamespace\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e \u003cspan class=\"pl-s1\"\u003etypeName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e typeName\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eReplace\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eSomeNamespace\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eAnotherNamespace\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e Type\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eGetType\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003etypeName\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-security\"\u003e\u003c/a\u003eSecurity\u003c/h2\u003e\u003ca id=\"user-content-security\" class=\"anchor\" aria-label=\"Permalink: Security\" href=\"#security\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eDeserializing data from an untrusted source can introduce security vulnerabilities in your application.\nDepending on the settings used during deserialization, \u003cstrong\u003euntrusted data may be able to execute arbitrary code\u003c/strong\u003e or cause a denial of service attack.\nUntrusted data might come from over the network from an untrusted source (e.g. any and every networked client) or can be tampered with by an intermediary when transmitted over an unauthenticated connection, or from a local storage that might have been tampered with, or many other sources. MessagePack for C# does not provide any means to authenticate data or make it tamper-resistant. Please use an appropriate method of authenticating data before deserialization - such as a \u003ca href=\"https://en.wikipedia.org/wiki/Message_authentication_code\" rel=\"nofollow\"\u003e\u003ccode\u003eMAC\u003c/code\u003e\u003c/a\u003e .\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ePlease be very mindful of these attack scenarios; many projects and companies, and serialization library users in general, have been bitten by untrusted user data deserialization in the past.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWhen deserializing untrusted data, put MessagePack into a more secure mode by configuring your \u003ccode\u003eMessagePackSerializerOptions.Security\u003c/code\u003e property:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"var options = MessagePackSerializerOptions.Standard\n .WithSecurity(MessagePackSecurity.UntrustedData);\n\n// Pass the options explicitly for the greatest control.\nT object = MessagePackSerializer.Deserialize\u0026lt;T\u0026gt;(data, options);\n\n// Or set the security level as the default.\nMessagePackSerializer.DefaultOptions = options;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializerOptions\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandard\n \u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWithSecurity\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSecurity\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUntrustedData\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Pass the options explicitly for the greatest control.\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eobject\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003edata\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e options\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Or set the security level as the default.\u003c/span\u003e\nMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDefaultOptions \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou should also avoid the Typeless serializer/formatters/resolvers for untrusted data as that opens the door for the untrusted data to potentially deserialize unanticipated types that can compromise security.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eUntrustedData\u003c/code\u003e mode merely hardens against some common attacks, but is no fully secure solution in itself.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePerformance\u003c/h2\u003e\u003ca id=\"user-content-performance\" class=\"anchor\" aria-label=\"Permalink: Performance\" href=\"#performance\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBenchmarks comparing MessagePack For C# to other serializers were run on \u003ccode\u003eWindows 10 Pro x64 Intel Core i7-6700K 4.00GHz, 32GB RAM\u003c/code\u003e. Benchmark code is \u003ca href=\"https://github.com/neuecc/ZeroFormatter/tree/master/sandbox/PerformanceComparison\"\u003eavailable here\u003c/a\u003e - and their \u003ca href=\"https://github.com/neuecc/ZeroFormatter/blob/bc63cb925d/sandbox/PerformanceComparison/packages.config\"\u003eversion info\u003c/a\u003e.\n\u003ca href=\"https://github.com/neuecc/ZeroFormatter/\"\u003eZeroFormatter\u003c/a\u003e and \u003ca href=\"https://google.github.io/flatbuffers/\" rel=\"nofollow\"\u003eFlatBuffers\u003c/a\u003e have infinitely fast deserializers, so ignore their deserialization performance.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://cloud.githubusercontent.com/assets/46207/23835765/55fe494e-07b0-11e7-98be-5e7a9411da40.png\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/46207/23835765/55fe494e-07b0-11e7-98be-5e7a9411da40.png\" alt=\"image\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# uses many techniques to improve performance.\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eThe serializer uses \u003ccode\u003eIBufferWriter\u0026lt;byte\u0026gt;\u003c/code\u003e rather than \u003ccode\u003eSystem.IO.Stream\u003c/code\u003e to reduce memory overhead.\u003c/li\u003e\n\u003cli\u003eBuffers are rented from pools to reduce allocations, keeping throughput high through reduced GC pressure.\u003c/li\u003e\n\u003cli\u003eDon't create intermediate utility instances (\u003ccode\u003e*Writer/*Reader\u003c/code\u003e, \u003ccode\u003e*Context\u003c/code\u003e, etc...)\u003c/li\u003e\n\u003cli\u003eUtilize dynamic code generation and JIT to avoid boxing value types. Use AOT generation on platforms that prohibit JITs.\u003c/li\u003e\n\u003cli\u003eCached generated formatters on static generic fields (don't use dictionary-cache because dictionary lookup is overhead). See \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp/tree/209f301e2e595ed366408624011ba2e856d23429/src/MessagePack/Resolvers\"\u003eResolvers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eHeavily tuned dynamic IL code generation and JIT to avoid boxing value types. See \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp/blob/209f301e2e595ed366408624011ba2e856d23429/src/MessagePack/Resolvers/DynamicObjectResolver.cs#L142-L754\"\u003eDynamicObjectTypeBuilder\u003c/a\u003e. Use AOT generation on platforms that prohibit JIT.\u003c/li\u003e\n\u003cli\u003eCall the Primitive API directly when IL code generation determines target types to be primitive.\u003c/li\u003e\n\u003cli\u003eReduce branching of variable length formats when IL code generation knows the target type (integer/string) ranges\u003c/li\u003e\n\u003cli\u003eDon't use the \u003ccode\u003eIEnumerable\u0026lt;T\u0026gt;\u003c/code\u003e abstraction to iterate over collections when possible, \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp/blob/209f301e2e595ed366408624011ba2e856d23429/src/MessagePack/Formatters/CollectionFormatter.cs#L192-L355\"\u003esee: CollectionFormatterBase\u003c/a\u003e and derived collection formatters\u003c/li\u003e\n\u003cli\u003eUse pre-generated lookup tables to reduce checks of mgpack type constraints, \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp/blob/209f301e2e595ed366408624011ba2e856d23429/src/MessagePack/MessagePackBinary.cs#L15-L212\"\u003esee: MessagePackBinary\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eUses optimized type key dictionary for non-generic methods, \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp/blob/91312921cb7fe987f48336768c898a76ac7dbb40/src/MessagePack/Internal/ThreadsafeTypeKeyHashTable.cs\"\u003esee: ThreadsafeTypeKeyHashTable\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eAvoid string key decoding for lookup maps (string key and use automata based name lookup with inlined IL code generation, see: \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp/blob/bcedbce3fd98cb294210d6b4a22bdc4c75ccd916/src/MessagePack/Internal/AutomataDictionary.cs\"\u003eAutomataDictionary\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eTo encode string keys, use pre-generated member name bytes and fixed sized byte array copies in IL, see: \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp/blob/f17ddc5d107d3a2f66f60398b214ef87919ff892/src/MessagePack/Internal/UnsafeMemory.cs\"\u003eUnsafeMemory.cs\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eBefore creating this library, I implemented a fast serializer with \u003ca href=\"https://github.com/neuecc/ZeroFormatter#performance\"\u003eZeroFormatter#Performance\u003c/a\u003e. This is a further evolved implementation. MessagePack for C# is always fast and optimized for all types (primitive, small struct, large object, any collections).\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-deserialize-performance\"\u003e\u003c/a\u003eDeserialization Performance for different options\u003c/h3\u003e\u003ca id=\"user-content-deserialization-performance-for-different-options\" class=\"anchor\" aria-label=\"Permalink: Deserialization Performance for different options\" href=\"#deserialization-performance-for-different-options\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ePerformance varies depending on the options used. This is a micro benchmark with \u003ca href=\"https://github.com/dotnet/BenchmarkDotNet\"\u003eBenchmarkDotNet\u003c/a\u003e. The target object has 9 members (\u003ccode\u003eMyProperty1\u003c/code\u003e ~ \u003ccode\u003eMyProperty9\u003c/code\u003e), values are zero.\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eMethod\u003c/th\u003e\n\u003cth align=\"right\"\u003eMean\u003c/th\u003e\n\u003cth align=\"right\"\u003eError\u003c/th\u003e\n\u003cth align=\"right\"\u003eScaled\u003c/th\u003e\n\u003cth align=\"right\"\u003eGen 0\u003c/th\u003e\n\u003cth align=\"right\"\u003eAllocated\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eM IntKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e72.67 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1.00\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0132\u003c/td\u003e\n\u003ctd align=\"right\"\u003e56 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eM StringKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e217.95 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e3.00\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0131\u003c/td\u003e\n\u003ctd align=\"right\"\u003e56 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eM Typeless_IntKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e176.71 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e2.43\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0131\u003c/td\u003e\n\u003ctd align=\"right\"\u003e56 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eM Typeless_StringKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e378.64 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e5.21\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0129\u003c/td\u003e\n\u003ctd align=\"right\"\u003e56 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eMsgPackCliMap\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1,355.26 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e18.65\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.1431\u003c/td\u003e\n\u003ctd align=\"right\"\u003e608 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eMsgPackCliArray\u003c/td\u003e\n\u003ctd align=\"right\"\u003e455.28 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e6.26\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0415\u003c/td\u003e\n\u003ctd align=\"right\"\u003e176 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eProtobufNet\u003c/td\u003e\n\u003ctd align=\"right\"\u003e265.85 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e3.66\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0319\u003c/td\u003e\n\u003ctd align=\"right\"\u003e136 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eHyperion\u003c/td\u003e\n\u003ctd align=\"right\"\u003e366.47 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e5.04\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0949\u003c/td\u003e\n\u003ctd align=\"right\"\u003e400 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eJsonNetString\u003c/td\u003e\n\u003ctd align=\"right\"\u003e2,783.39 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e38.30\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.6790\u003c/td\u003e\n\u003ctd align=\"right\"\u003e2864 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eJsonNetStreamReader\u003c/td\u003e\n\u003ctd align=\"right\"\u003e3,297.90 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e45.38\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1.4267\u003c/td\u003e\n\u003ctd align=\"right\"\u003e6000 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eJilString\u003c/td\u003e\n\u003ctd align=\"right\"\u003e553.65 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e7.62\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0362\u003c/td\u003e\n\u003ctd align=\"right\"\u003e152 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eJilStreamReader\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1,408.46 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e19.38\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.8450\u003c/td\u003e\n\u003ctd align=\"right\"\u003e3552 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eÌntKey\u003c/code\u003e, \u003ccode\u003eStringKey\u003c/code\u003e, \u003ccode\u003eTypeless_IntKey\u003c/code\u003e, \u003ccode\u003eTypeless_StringKey\u003c/code\u003e are MessagePack for C# options. All MessagePack for C# options achieve zero memory allocations in the deserialization process. \u003ccode\u003eJsonNetString\u003c/code\u003e/\u003ccode\u003eJilString\u003c/code\u003e is deserialized from strings. \u003ccode\u003eJsonNetStreamReader\u003c/code\u003e/\u003ccode\u003eJilStreamReader\u003c/code\u003e is deserialized from UTF-8 byte arrays using \u003ccode\u003eStreamReader\u003c/code\u003e. Deserialization is normally read from Stream. Thus, it will be restored from byte arrays (or Stream) instead of strings.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# \u003ccode\u003eIntKey\u003c/code\u003e is the fastest. \u003ccode\u003eStringKey\u003c/code\u003e is slower than \u003ccode\u003eIntKey\u003c/code\u003e because matching the character string of property names is required. \u003ccode\u003eIntKey\u003c/code\u003e works by reading the array length, then \u003ccode\u003efor (array length) { binary decode }\u003c/code\u003e. \u003ccode\u003eStringKey\u003c/code\u003e works by reading map length, \u003ccode\u003efor (map length) { decode key, lookup key, binary decode }\u003c/code\u003e, so it requires an additional two steps (decoding of keys and lookups of keys).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eString key is often a useful, contractless, simple replacement of JSON, interoperability with other languages, and more robust versioning. MessagePack for C# is also optimized for string keys as much a possible. First of all, it does not decode UTF-8 byte arrays to full string for matching with the member name; instead it will look up the byte arrays as it is (to avoid decoding costs and extra memory allocations).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAnd It will try to match each \u003ccode\u003elong type\u003c/code\u003e (per 8 character, if it is not enough, pad with 0) using \u003ca href=\"https://en.wikipedia.org/wiki/Automata_theory\" rel=\"nofollow\"\u003eautomata\u003c/a\u003e and inline it when generating IL code.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://user-images.githubusercontent.com/46207/29754771-216b40e2-8bc7-11e7-8310-1c3602e80a08.png\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/46207/29754771-216b40e2-8bc7-11e7-8310-1c3602e80a08.png\" alt=\"image\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis also avoids calculating the hash code of byte arrays, and the comparison can be made several times faster using the long type.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis is the sample of decompiled generated deserializer code, decompiled using \u003ca href=\"http://ilspy.net/\" rel=\"nofollow\"\u003eILSpy\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://user-images.githubusercontent.com/46207/29754804-b5ba0f44-8bc7-11e7-9f6b-0c8f3c041237.png\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/46207/29754804-b5ba0f44-8bc7-11e7-9f6b-0c8f3c041237.png\" alt=\"image\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf the number of nodes is large, searches will use an embedded binary search.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eExtra note, this is serialization benchmark result.\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eMethod\u003c/th\u003e\n\u003cth align=\"right\"\u003eMean\u003c/th\u003e\n\u003cth align=\"right\"\u003eError\u003c/th\u003e\n\u003cth align=\"right\"\u003eScaled\u003c/th\u003e\n\u003cth align=\"right\"\u003eGen 0\u003c/th\u003e\n\u003cth align=\"right\"\u003eAllocated\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eIntKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e84.11 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1.00\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0094\u003c/td\u003e\n\u003ctd align=\"right\"\u003e40 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eStringKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e126.75 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1.51\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0341\u003c/td\u003e\n\u003ctd align=\"right\"\u003e144 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eTypeless_IntKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e183.31 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e2.18\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0265\u003c/td\u003e\n\u003ctd align=\"right\"\u003e112 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eTypeless_StringKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e193.95 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e2.31\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0513\u003c/td\u003e\n\u003ctd align=\"right\"\u003e216 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eMsgPackCliMap\u003c/td\u003e\n\u003ctd align=\"right\"\u003e967.68 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e11.51\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.1297\u003c/td\u003e\n\u003ctd align=\"right\"\u003e552 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eMsgPackCliArray\u003c/td\u003e\n\u003ctd align=\"right\"\u003e284.20 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e3.38\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.1006\u003c/td\u003e\n\u003ctd align=\"right\"\u003e424 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eProtobufNet\u003c/td\u003e\n\u003ctd align=\"right\"\u003e176.43 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e2.10\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.0665\u003c/td\u003e\n\u003ctd align=\"right\"\u003e280 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eHyperion\u003c/td\u003e\n\u003ctd align=\"right\"\u003e280.14 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e3.33\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.1674\u003c/td\u003e\n\u003ctd align=\"right\"\u003e704 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eZeroFormatter\u003c/td\u003e\n\u003ctd align=\"right\"\u003e149.95 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1.78\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.1009\u003c/td\u003e\n\u003ctd align=\"right\"\u003e424 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eJsonNetString\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1,432.55 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e17.03\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.4616\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1944 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eJsonNetStreamWriter\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1,775.72 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e21.11\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1.5526\u003c/td\u003e\n\u003ctd align=\"right\"\u003e6522 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eJilString\u003c/td\u003e\n\u003ctd align=\"right\"\u003e547.51 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e6.51\u003c/td\u003e\n\u003ctd align=\"right\"\u003e0.3481\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1464 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eJilStreamWriter\u003c/td\u003e\n\u003ctd align=\"right\"\u003e778.78 ns\u003c/td\u003e\n\u003ctd align=\"right\"\u003eNA\u003c/td\u003e\n\u003ctd align=\"right\"\u003e9.26\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1.4448\u003c/td\u003e\n\u003ctd align=\"right\"\u003e6066 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eOf course, \u003ccode\u003eIntKey\u003c/code\u003e is fastest but \u003ccode\u003eStringKey\u003c/code\u003e also performs reasonably well.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-string-interning\"\u003e\u003c/a\u003eString interning\u003c/h3\u003e\u003ca id=\"user-content-string-interning\" class=\"anchor\" aria-label=\"Permalink: String interning\" href=\"#string-interning\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe msgpack format does not provide for reusing strings in the data stream.\nThis naturally leads the deserializer to create a new \u003ccode\u003estring\u003c/code\u003e object for every string encountered,\neven if it is equal to another string previously encountered.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWhen deserializing data that may contain the same strings repeatedly it can be worthwhile\nto have the deserializer take a little extra time to check whether it has seen a given string before\nand reuse it if it has.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo enable string interning on \u003cem\u003eall\u003c/em\u003e string values, use a resolver that specifies \u003ccode\u003eStringInterningFormatter\u003c/code\u003e\nbefore any of the standard ones, like this:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"var options = MessagePackSerializerOptions.Standard.WithResolver(\n CompositeResolver.Create(\n new IMessagePackFormatter[] { new StringInterningFormatter() },\n new IFormatterResolver[] { StandardResolver.Instance }));\n\nMessagePackSerializer.Deserialize\u0026lt;ClassOfStrings\u0026gt;(data, options);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializerOptions\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandard\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWithResolver\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n CompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eCreate\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e IMessagePackFormatter\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e StringInterningFormatter\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e IFormatterResolver\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e StandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\nMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eClassOfStrings\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003edata\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e options\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you know which fields of a particular type are likely to contain duplicate strings,\nyou can apply the string interning formatter to just those fields so the deserializer only pays\nfor the interned string check where it matters most.\nNote that this technique requires a \u003ccode\u003e[MessagePackObject]\u003c/code\u003e or \u003ccode\u003e[DataContract]\u003c/code\u003e class.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackObject]\npublic class ClassOfStrings\n{\n [Key(0)]\n [MessagePackFormatter(typeof(StringInterningFormatter))]\n public string InternedString { get; set; }\n\n [Key(1)]\n public string OrdinaryString { get; set; }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eClassOfStrings\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackFormatter\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eStringInterningFormatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eInternedString\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eOrdinaryString\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you are writing your own formatter for some type that contains strings,\nyou can call on the \u003ccode\u003eStringInterningFormatter\u003c/code\u003e directly from your formatter as well for the strings.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLZ4 Compression\u003c/h2\u003e\u003ca id=\"user-content-lz4-compression\" class=\"anchor\" aria-label=\"Permalink: LZ4 Compression\" href=\"#lz4-compression\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePack is a fast and \u003cem\u003ecompact\u003c/em\u003e format but it is not compression. \u003ca href=\"https://github.com/lz4/lz4\"\u003eLZ4\u003c/a\u003e is an extremely fast compression algorithm, and using it MessagePack for C# can achieve extremely fast performance as well as extremely compact binary sizes!\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# has built-in LZ4 support. You can activate it using a modified options object and passing it into an API like this:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"var lz4Options = MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray);\nMessagePackSerializer.Serialize(obj, lz4Options);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003elz4Options\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializerOptions\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandard\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWithCompression\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackCompression\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eLz4BlockArray\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\nMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eobj\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e lz4Options\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eMessagePackCompression\u003c/code\u003e has two modes, \u003ccode\u003eLz4Block\u003c/code\u003e and \u003ccode\u003eLz4BlockArray\u003c/code\u003e. Neither is a simple binary LZ4 compression, but a special compression integrated into the serialization pipeline, using MessagePack \u003ccode\u003eext\u003c/code\u003e code (\u003ccode\u003eLz4BlockArray (98)\u003c/code\u003e or \u003ccode\u003eLz4Block (99)\u003c/code\u003e). Therefore, it is not readily compatible with compression offered in other languages.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eLz4Block\u003c/code\u003e compresses an entire MessagePack sequence as a single LZ4 block. This is the simple compression that achieves best compression ratio, at the cost of copying the entire sequence when necessary to get contiguous memory.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eLz4BlockArray\u003c/code\u003e compresses an entire MessagePack sequence as a array of LZ4 blocks. Compressed/decompressed blocks are chunked and thus do not enter the GC's Large-Object-Heap, but the compression ratio is slightly worse.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWe recommend to use \u003ccode\u003eLz4BlockArray\u003c/code\u003e as the default when using compression.\nFor compatibility with MessagePack v1.x, use \u003ccode\u003eLz4Block\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eRegardless of which LZ4 option is set at the deserialization, both methods can be deserialized. For example, when the \u003ccode\u003eLz4BlockArray\u003c/code\u003e option was used, binary data using either \u003ccode\u003eLz4Block\u003c/code\u003e and \u003ccode\u003eLz4BlockArray\u003c/code\u003e can be deserialized. Neither can be decompressed and hence deserialized when the compression option is set to \u003ccode\u003eNone\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eAttributions\u003c/h3\u003e\u003ca id=\"user-content-attributions\" class=\"anchor\" aria-label=\"Permalink: Attributions\" href=\"#attributions\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eLZ4 compression support is using Milosz Krajewski's \u003ca href=\"https://github.com/MiloszKrajewski/lz4net\"\u003elz4net\u003c/a\u003e code with some modifications.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-comparison\"\u003e\u003c/a\u003eComparison with protobuf, JSON, ZeroFormatter\u003c/h2\u003e\u003ca id=\"user-content-comparison-with-protobuf-json-zeroformatter\" class=\"anchor\" aria-label=\"Permalink: Comparison with protobuf, JSON, ZeroFormatter\" href=\"#comparison-with-protobuf-json-zeroformatter\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://github.com/mgravell/protobuf-net\"\u003eprotobuf-net\u003c/a\u003e is major, widely used binary-format library on .NET. I love protobuf-net and respect their great work. But when you use protobuf-net as a general purpose serialization format, you may encounter an annoying issue.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[ProtoContract]\npublic class Parent\n{\n [ProtoMember(1)]\n public int Primitive { get; set; }\n [ProtoMember(2)]\n public Child Prop { get; set; }\n [ProtoMember(3)]\n public int[] Array { get; set; }\n}\n\n[ProtoContract]\npublic class Child\n{\n [ProtoMember(1)]\n public int Number { get; set; }\n}\n\nusing (var ms = new MemoryStream())\n{\n // serialize null.\n ProtoBuf.Serializer.Serialize\u0026lt;Parent\u0026gt;(ms, null);\n\n ms.Position = 0;\n var result = ProtoBuf.Serializer.Deserialize\u0026lt;Parent\u0026gt;(ms);\n\n Console.WriteLine(result != null); // True, not null. but all property are zero formatted.\n Console.WriteLine(result.Primitive); // 0\n Console.WriteLine(result.Prop); // null\n Console.WriteLine(result.Array); // null\n}\n\nusing (var ms = new MemoryStream())\n{\n // serialize empty array.\n ProtoBuf.Serializer.Serialize\u0026lt;Parent\u0026gt;(ms, new Parent { Array = System.Array.Empty\u0026lt;int\u0026gt;() });\n\n ms.Position = 0;\n var result = ProtoBuf.Serializer.Deserialize\u0026lt;Parent\u0026gt;(ms);\n\n Console.WriteLine(result.Array == null); // True, null!\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eProtoContract\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eParent\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eProtoMember\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ePrimitive\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eProtoMember\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eChild\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eProp\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eProtoMember\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e3\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e Array \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eProtoContract\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eChild\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eProtoMember\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eNumber\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\nusing \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ems\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e MemoryStream\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// serialize null.\u003c/span\u003e\n ProtoBuf\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eParent\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ems\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e null\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n ms\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003ePosition\u003cspan class=\"pl-s1\"\u003e\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e ProtoBuf\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eParent\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ems\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eresult \u003cspan class=\"pl-c1\"\u003e!=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e// True, not null. but all property are zero formatted.\u003c/span\u003e\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eresult\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003ePrimitive\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e// 0\u003c/span\u003e\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eresult\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eProp\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e// null\u003c/span\u003e\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eresult\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eArray\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e// null\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\nusing \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ems\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e MemoryStream\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// serialize empty array.\u003c/span\u003e\n ProtoBuf\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eParent\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ems\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e new Parent \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e Array \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e System\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eArray\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eEmpty\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n ms\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003ePosition\u003cspan class=\"pl-s1\"\u003e\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresult\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e ProtoBuf\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eParent\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ems\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n Console\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eWriteLine\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eresult\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eArray \u003cspan class=\"pl-c1\"\u003e==\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e// True, null!\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eprotobuf(-net) cannot handle null and empty collection correctly, because protobuf has no \u003ccode\u003enull\u003c/code\u003e representation (see \u003ca href=\"https://stackoverflow.com/questions/21631428/protobuf-net-deserializes-empty-collection-to-null-when-the-collection-is-a-prop/21632160#21632160\" rel=\"nofollow\"\u003ethis SO answer from a protobuf-net author\u003c/a\u003e).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://github.com/msgpack/msgpack/blob/master/spec.md#type-system\"\u003eMessagePack's type system\u003c/a\u003e can correctly serialize the entire C# type system. This is a strong reason to recommend MessagePack over protobuf.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eProtocol Buffers have good IDL and \u003ca href=\"https://www.grpc.io/\" rel=\"nofollow\"\u003egRPC\u003c/a\u003e support. If you want to use IDL, I recommend \u003ca href=\"https://github.com/google/protobuf/tree/master/csharp/src/Google.Protobuf\"\u003eGoogle.Protobuf\u003c/a\u003e over MessagePack.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eJSON is good general-purpose format. It is simple, human-readable and thoroughly-enough specified. \u003ca href=\"https://github.com/neuecc/Utf8Json\"\u003eUtf8Json\u003c/a\u003e - which I created as well - adopts same architecture as MessagePack for C# and avoids encoding/decoding costs as much as possible just like this library does. If you want to know more about binary vs text formats, see \u003ca href=\"https://github.com/neuecc/Utf8Json#which-serializer-should-be-used\"\u003eUtf8Json/which serializer should be used\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://github.com/neuecc/ZeroFormatter/\"\u003eZeroFormatter\u003c/a\u003e is similar as \u003ca href=\"https://google.github.io/flatbuffers/\" rel=\"nofollow\"\u003eFlatBuffers\u003c/a\u003e but specialized to C#, and special in that regard. Deserialization is infinitely fast but the produced binary size is larger. And ZeroFormatter's caching algorithm requires additional memory.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFor many common uses, MessagePack for C# would be a better fit.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eHints to achieve maximum performance when using MessagePack for C#\u003c/h2\u003e\u003ca id=\"user-content-hints-to-achieve-maximum-performance-when-using-messagepack-for-c\" class=\"anchor\" aria-label=\"Permalink: Hints to achieve maximum performance when using MessagePack for C#\" href=\"#hints-to-achieve-maximum-performance-when-using-messagepack-for-c\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# prioritizes maximum performance by default. However, there are also some options that sacrifice performance for convenience.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUse indexed keys instead of string keys (Contractless)\u003c/h3\u003e\u003ca id=\"user-content-use-indexed-keys-instead-of-string-keys-contractless\" class=\"anchor\" aria-label=\"Permalink: Use indexed keys instead of string keys (Contractless)\" href=\"#use-indexed-keys-instead-of-string-keys-contractless\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp#deserialize-performance\"\u003eDeserialization Performance for different options\u003c/a\u003e section shows the results of indexed keys (\u003ccode\u003eIntKey\u003c/code\u003e) vs string keys (\u003ccode\u003eStringKey\u003c/code\u003e) performance. Indexed keys serialize the object graph as a MessagePack array. String keys serializes the object graph as a MessagePack map.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFor example this type is serialized to\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackObject]\npublic class Person\n{\n [Key(0)] or [Key(\u0026quot;name\u0026quot;)]\n public string Name { get; set;}\n [Key(1)] or [Key(\u0026quot;age\u0026quot;)]\n public int Age { get; set;}\n}\n\nnew Person { Name = \u0026quot;foobar\u0026quot;, Age = 999 }\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ePerson\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e or \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003ename\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n public string Name \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e or \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003eage\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n public int Age \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e\u003c/span\u003e Person \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003efoobar\u003cspan class=\"pl-s\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eAge\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e999\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ccode\u003eIntKey\u003c/code\u003e: \u003ccode\u003e[\"foobar\", 999]\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eStringKey\u003c/code\u003e: \u003ccode\u003e{\"name:\"foobar\",\"age\":999}\u003c/code\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eIntKey\u003c/code\u003e is always fast in both serialization and deserialization because it does not have to handle and lookup key names, and always has the smaller binary size.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eStringKey\u003c/code\u003e is often a useful, contractless, simple replacement for JSON, interoperability with other languages with MessagePack support, and less error prone versioning. But to achieve maximum performance, use \u003ccode\u003eIntKey\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCreate own custom composite resolver\u003c/h3\u003e\u003ca id=\"user-content-create-own-custom-composite-resolver\" class=\"anchor\" aria-label=\"Permalink: Create own custom composite resolver\" href=\"#create-own-custom-composite-resolver\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eCompositeResolver.Create\u003c/code\u003e is an easy way to create composite resolvers. But formatter lookups have some overhead. If you create a custom resolver (or use \u003ccode\u003eStaticCompositeResolver.Instance\u003c/code\u003e), you can avoid this overhead.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public class MyApplicationResolver : IFormatterResolver\n{\n public static readonly IFormatterResolver Instance = new MyApplicationResolver();\n\n // configure your custom resolvers.\n private static readonly IFormatterResolver[] Resolvers = new IFormatterResolver[]\n {\n };\n\n private MyApplicationResolver() { }\n\n public IMessagePackFormatter\u0026lt;T\u0026gt; GetFormatter\u0026lt;T\u0026gt;()\n {\n return Cache\u0026lt;T\u0026gt;.Formatter;\n }\n\n private static class Cache\u0026lt;T\u0026gt;\n {\n public static IMessagePackFormatter\u0026lt;T\u0026gt; Formatter;\n\n static Cache()\n {\n // configure your custom formatters.\n if (typeof(T) == typeof(XXX))\n {\n Formatter = new ICustomFormatter();\n return;\n }\n\n foreach (var resolver in Resolvers)\n {\n var f = resolver.GetFormatter\u0026lt;T\u0026gt;();\n if (f != null)\n {\n Formatter = f;\n return;\n }\n }\n }\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMyApplicationResolver\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIFormatterResolver\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereadonly\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIFormatterResolver\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eInstance\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e MyApplicationResolver\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// configure your custom resolvers.\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eprivate\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereadonly\u003c/span\u003e IFormatterResolver\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eResolvers\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e IFormatterResolver\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003eprivate\u003c/span\u003e \u003cspan class=\"pl-v\"\u003eMyApplicationResolver\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eGetFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eCache\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eFormatter\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003eprivate\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eCache\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFormatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-v\"\u003eCache\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// configure your custom formatters.\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e==\u003c/span\u003e \u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eXXX\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eFormatter\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e ICustomFormatter\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003eforeach\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e resolver \u003cspan class=\"pl-k\"\u003ein\u003c/span\u003e Resolvers\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ef\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e resolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eGetFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ef\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e!=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eFormatter\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ef\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003eNOTE: If you are creating a library, recommend using the above custom resolver instead of \u003ccode\u003eCompositeResolver.Create\u003c/code\u003e. Also, libraries must not use \u003ccode\u003eStaticCompositeResolver\u003c/code\u003e - as it is global state - to avoid compatibility issues.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUse native resolvers\u003c/h3\u003e\u003ca id=\"user-content-use-native-resolvers\" class=\"anchor\" aria-label=\"Permalink: Use native resolvers\" href=\"#use-native-resolvers\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBy default, MessagePack for C# serializes GUID as string. This is much slower than the native .NET format GUID. The same applies to Decimal. If your application makes heavy use of GUID or Decimal and you don't have to worry about interoperability with other languages, you can replace them with the native serializers \u003ccode\u003eNativeGuidResolver\u003c/code\u003e and \u003ccode\u003eNativeDecimalResolver\u003c/code\u003e respectively.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAlso, \u003ccode\u003eDateTime\u003c/code\u003e is serialized using the MessagePack timestamp format. By using the \u003ccode\u003eNativeDateTimeResolver\u003c/code\u003e, it is possible to maintain Kind and perform faster serialization.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBe careful when copying buffers\u003c/h3\u003e\u003ca id=\"user-content-be-careful-when-copying-buffers\" class=\"anchor\" aria-label=\"Permalink: Be careful when copying buffers\" href=\"#be-careful-when-copying-buffers\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eMessagePackSerializer.Serialize\u003c/code\u003e returns \u003ccode\u003ebyte[]\u003c/code\u003e in default. The final \u003ccode\u003ebyte[]\u003c/code\u003e is copied from an internal buffer pool. That is an extra cost. You can use \u003ccode\u003eIBufferWriter\u0026lt;T\u0026gt;\u003c/code\u003e or the \u003ccode\u003eStream\u003c/code\u003e API to write to buffers directly. If you want to use a buffer pool outside of the serializer, you should implement custom \u003ccode\u003eIBufferWriter\u0026lt;byte\u0026gt;\u003c/code\u003e or use an existing one such as \u003ca href=\"https://github.com/AArnott/Nerdbank.Streams/blob/master/doc/Sequence.md\"\u003e\u003ccode\u003eSequence\u0026lt;T\u0026gt;\u003c/code\u003e\u003c/a\u003e from the \u003ca href=\"https://nuget.org/packages/Nerdbank.Streams\" rel=\"nofollow\"\u003eNerdbank.Streams\u003c/a\u003e package.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eDuring deserialization, \u003ccode\u003eMessagePackSerializer.Deserialize(ReadOnlyMemory\u0026lt;byte\u0026gt; buffer)\u003c/code\u003e is better than the \u003ccode\u003eDeserialize(Stream stream)\u003c/code\u003e overload. This is because the Stream API version starts by reading the data, generating a \u003ccode\u003eReadOnlySequence\u0026lt;byte\u0026gt;\u003c/code\u003e, and only then starts the deserialization.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eChoosing compression\u003c/h3\u003e\u003ca id=\"user-content-choosing-compression\" class=\"anchor\" aria-label=\"Permalink: Choosing compression\" href=\"#choosing-compression\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eCompression is generally effective when there is duplicate data. In MessagePack, arrays containing objects using string keys (Contractless) can be compressed efficiently because compression can be applied to many duplicate property names. Indexed keys compression is not as effectively compressed as string keys, but indexed keys are smaller in the first place.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis is some example benchmark performance data;\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eSerializer\u003c/th\u003e\n\u003cth align=\"right\"\u003eMean\u003c/th\u003e\n\u003cth align=\"right\"\u003eDataSize\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eIntKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e2.941 us\u003c/td\u003e\n\u003ctd align=\"right\"\u003e469.00 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eIntKey(Lz4)\u003c/td\u003e\n\u003ctd align=\"right\"\u003e3.449 us\u003c/td\u003e\n\u003ctd align=\"right\"\u003e451.00 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eStringKey\u003c/td\u003e\n\u003ctd align=\"right\"\u003e4.340 us\u003c/td\u003e\n\u003ctd align=\"right\"\u003e1023.00 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eStringKey(Lz4)\u003c/td\u003e\n\u003ctd align=\"right\"\u003e5.469 us\u003c/td\u003e\n\u003ctd align=\"right\"\u003e868.00 B\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eIntKey(Lz4)\u003c/code\u003e is not as effectively compressed, but performance is still somewhat degraded. On the other hand, \u003ccode\u003eStringKey\u003c/code\u003e can be expected to have a sufficient effect on the binary size. However, this is just an example. Compression can be quite effective depending on the data, too, or have little effect other than slowing down your program. There are also cases in which well-compressible data exists in the values (such as long strings, e.g. containing HTML data with many repeated HTML tags). It is important to verify the actual effects of compression on a case by case basis.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eExtensions\u003c/h2\u003e\u003ca id=\"user-content-extensions\" class=\"anchor\" aria-label=\"Permalink: Extensions\" href=\"#extensions\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# has extension points that enable you to provide optimal serialization support for custom types. There are official extension support packages.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-powershell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Install-Package MessagePack.ReactiveProperty\nInstall-Package MessagePack.UnityShims\nInstall-Package MessagePack.AspNetCoreMvcFormatter\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003eInstall-Package\u003c/span\u003e MessagePack.ReactiveProperty\n\u003cspan class=\"pl-c1\"\u003eInstall-Package\u003c/span\u003e MessagePack.UnityShims\n\u003cspan class=\"pl-c1\"\u003eInstall-Package\u003c/span\u003e MessagePack.AspNetCoreMvcFormatter\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eMessagePack.ReactiveProperty\u003c/code\u003e package adds support for types of the \u003ca href=\"https://github.com/runceel/ReactiveProperty\"\u003eReactiveProperty\u003c/a\u003e library. It adds \u003ccode\u003eReactiveProperty\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eIReactiveProperty\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eIReadOnlyReactiveProperty\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eReactiveCollection\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eUnit\u003c/code\u003e serialization support. It is useful for save viewmodel state.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eMessagePack.UnityShims\u003c/code\u003e package provides shims for \u003ca href=\"https://unity3d.com/\" rel=\"nofollow\"\u003eUnity\u003c/a\u003e's standard structs (\u003ccode\u003eVector2\u003c/code\u003e, \u003ccode\u003eVector3\u003c/code\u003e, \u003ccode\u003eVector4\u003c/code\u003e, \u003ccode\u003eQuaternion\u003c/code\u003e, \u003ccode\u003eColor\u003c/code\u003e, \u003ccode\u003eBounds\u003c/code\u003e, \u003ccode\u003eRect\u003c/code\u003e, \u003ccode\u003eAnimationCurve\u003c/code\u003e, \u003ccode\u003eKeyframe\u003c/code\u003e, \u003ccode\u003eMatrix4x4\u003c/code\u003e, \u003ccode\u003eGradient\u003c/code\u003e, \u003ccode\u003eColor32\u003c/code\u003e, \u003ccode\u003eRectOffset\u003c/code\u003e, \u003ccode\u003eLayerMask\u003c/code\u003e, \u003ccode\u003eVector2Int\u003c/code\u003e, \u003ccode\u003eVector3Int\u003c/code\u003e, \u003ccode\u003eRangeInt\u003c/code\u003e, \u003ccode\u003eRectInt\u003c/code\u003e, \u003ccode\u003eBoundsInt\u003c/code\u003e) and corresponding formatters. It can enable proper communication between servers and Unity clients.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAfter installation, extension packages must be enabled, by creating composite resolvers. Here is an example showing how to enable all extensions.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// Set extensions to default resolver.\nvar resolver = MessagePack.Resolvers.CompositeResolver.Create(\n // enable extension packages first\n ReactivePropertyResolver.Instance,\n MessagePack.Unity.Extension.UnityBlitResolver.Instance,\n MessagePack.Unity.UnityResolver.Instance,\n\n // finally use standard (default) resolver\n StandardResolver.Instance\n);\nvar options = MessagePackSerializerOptions.Standard.WithResolver(resolver);\n\n// Pass options every time or set as default\nMessagePackSerializer.DefaultOptions = options;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e// Set extensions to default resolver.\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresolver\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eCompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eCreate\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// enable extension packages first\u003c/span\u003e\n ReactivePropertyResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnity\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eExtension\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnityBlitResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnity\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnityResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// finally use standard (default) resolver\u003c/span\u003e\n StandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\n\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializerOptions\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandard\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWithResolver\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eresolver\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Pass options every time or set as default\u003c/span\u003e\nMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDefaultOptions \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFor configuration details, see: \u003ca href=\"#resolvers\"\u003eExtension Point section\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eMessagePack.AspNetCoreMvcFormatter\u003c/code\u003e is add-on for \u003ca href=\"https://github.com/aspnet/Mvc\"\u003eASP.NET Core MVC\u003c/a\u003e's serialization to boost up performance. This is configuration sample.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public void ConfigureServices(IServiceCollection services)\n{\n services.AddMvc().AddMvcOptions(option =\u0026gt;\n {\n option.OutputFormatters.Clear();\n option.OutputFormatters.Add(new MessagePackOutputFormatter(ContractlessStandardResolver.Options));\n option.InputFormatters.Clear();\n option.InputFormatters.Add(new MessagePackInputFormatter(ContractlessStandardResolver.Options));\n });\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eConfigureServices\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eIServiceCollection\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eservices\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n services\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eAddMvc\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eAddMvcOptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003eoption \u003cspan class=\"pl-c1\"\u003e=\u0026gt;\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e option\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOutputFormatters\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eClear\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e option\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOutputFormatters\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eAdd\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e MessagePackOutputFormatter\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eContractlessStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOptions\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e option\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInputFormatters\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eClear\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e option\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInputFormatters\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eAdd\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e MessagePackInputFormatter\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eContractlessStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eOptions\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s1\"\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eOther authors are creating extension packages, too.\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Cysharp/MagicOnion\"\u003eMagicOnion\u003c/a\u003e - gRPC based HTTP/2 RPC Streaming Framework\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Cysharp/MasterMemory\"\u003eMasterMemory\u003c/a\u003e - Embedded Readonly In-Memory Document Database\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eYou can make your own extension serializers or integrate with frameworks. Let's create and share!\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/pocketberserker/MessagePack.FSharpExtensions\"\u003eMessagePack.FSharpExtensions\u003c/a\u003e - supports F# list, set, map, unit, option, discriminated union\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ARKlab/MessagePack\"\u003eMessagePack.NodaTime\u003c/a\u003e - Support for NodaTime types to MessagePack C#\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/WebApiContrib/WebAPIContrib.Core#formatters\"\u003eWebApiContrib.Core.Formatter.MessagePack\u003c/a\u003e - supports ASP.NET Core MVC (\u003ca href=\"https://www.strathweb.com/2017/06/using-messagepack-with-asp-net-core-mvc/\" rel=\"nofollow\"\u003edetails in blog post\u003c/a\u003e)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/sketch7/MessagePack.MediaTypeFormatter\"\u003eMessagePack.MediaTypeFormatter\u003c/a\u003e - MessagePack MediaTypeFormatter\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eExperimental Features\u003c/h2\u003e\u003ca id=\"user-content-experimental-features\" class=\"anchor\" aria-label=\"Permalink: Experimental Features\" href=\"#experimental-features\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# has experimental features which provides you with very performant formatters. There is an official package.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-powershell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Install-Package MessagePack.Experimental\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003eInstall-Package\u003c/span\u003e MessagePack.Experimental\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFor detailed information, see: \u003ca href=\"/MessagePack-CSharp/MessagePack-CSharp/blob/master/src/MessagePack.Experimental/Experimental.md\"\u003eExperimental.md\u003c/a\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eAPI\u003c/h1\u003e\u003ca id=\"user-content-api\" class=\"anchor\" aria-label=\"Permalink: API\" href=\"#api\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eHigh-Level API (\u003ccode\u003eMessagePackSerializer\u003c/code\u003e)\u003c/h2\u003e\u003ca id=\"user-content-high-level-api-messagepackserializer\" class=\"anchor\" aria-label=\"Permalink: High-Level API (MessagePackSerializer)\" href=\"#high-level-api-messagepackserializer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eMessagePackSerializer\u003c/code\u003e class is the entry point of MessagePack for C#. Static methods make up the main API of MessagePack for C#.\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eAPI\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eSerialize\u0026lt;T\u0026gt;\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eSerializes an object graph to a MessagePack binary blob. Async variant for Stream available. Non-generic overloads available.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eDeserialize\u0026lt;T\u0026gt;\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eDeserializes a MessagePack binary to an object graph. Async variant for Stream available. Non-generic overloads available.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eSerializeToJson\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eSerialize a MessagePack-compatible object graph to JSON instead of MessagePack. Useful for debugging.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eConvertToJson\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eConvert MessagePack binary to JSON. Useful for debugging.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eConvertFromJson\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eConvert JSON to a MessagePack binary.\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eMessagePackSerializer.Typeless\u003c/code\u003e class offers most of the same APIs as above, but removes all type arguments from the API, forcing serialization to include the full type name of the root object. It uses the \u003ccode\u003eTypelessContractlessStandardResolver\u003c/code\u003e. Consider the result to be a .NET-specific MessagePack binary that isn't readily compatible with MessagePack deserializers in other runtimes.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# fundamentally serializes using \u003ccode\u003eIBufferWriter\u0026lt;byte\u0026gt;\u003c/code\u003e and deserializes using \u003ccode\u003eReadOnlySequence\u0026lt;byte\u0026gt;\u003c/code\u003e or \u003ccode\u003eMemory\u0026lt;byte\u0026gt;\u003c/code\u003e. Method overloads are provided to conveniently use it with common buffer types and the .NET \u003ccode\u003eStream\u003c/code\u003e class, but some of these convenience overloads require copying buffers once and therefore have a certain overhead.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe high-level API uses a memory pool internally to avoid unnecessary memory allocation. If result size is under 64K, it allocates GC memory only for the return bytes.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eEach serialize/deserialize method takes an optional \u003ccode\u003eMessagePackSerializerOptions\u003c/code\u003e parameter which can be used to specify a custom \u003ccode\u003eIFormatterResolver\u003c/code\u003e to use or to activate LZ4 compression support.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMultiple MessagePack structures on a single \u003ccode\u003eStream\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-multiple-messagepack-structures-on-a-single-stream\" class=\"anchor\" aria-label=\"Permalink: Multiple MessagePack structures on a single Stream\" href=\"#multiple-messagepack-structures-on-a-single-stream\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo deserialize a \u003ccode\u003eStream\u003c/code\u003e that contains multiple consecutive MessagePack data structures,\nyou can use the \u003ccode\u003eMessagePackStreamReader\u003c/code\u003e class to efficiently identify the \u003ccode\u003eReadOnlySequence\u0026lt;byte\u0026gt;\u003c/code\u003e\nfor each data structure and deserialize it. For example:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"static async Task\u0026lt;List\u0026lt;T\u0026gt;\u0026gt; DeserializeListFromStreamAsync\u0026lt;T\u0026gt;(Stream stream, CancellationToken cancellationToken)\n{\n var dataStructures = new List\u0026lt;T\u0026gt;();\n using (var streamReader = new MessagePackStreamReader(stream))\n {\n while (await streamReader.ReadAsync(cancellationToken) is ReadOnlySequence\u0026lt;byte\u0026gt; msgpack)\n {\n dataStructures.Add(MessagePackSerializer.Deserialize\u0026lt;T\u0026gt;(msgpack, cancellationToken: cancellationToken));\n }\n }\n\n return dataStructures;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003easync\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eTask\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eList\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eDeserializeListFromStreamAsync\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eStream\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003estream\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eCancellationToken\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ecancellationToken\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003edataStructures\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eList\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003estreamReader\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e MessagePackStreamReader\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003estream\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ewhile\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eawait\u003c/span\u003e streamReader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eReadAsync\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ecancellationToken\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eis\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eReadOnlySequence\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003ebyte\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e msgpack\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n dataStructures\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eAdd\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003emsgpack\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e cancellationToken\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e cancellationToken\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003edataStructures\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLow-Level API (\u003ccode\u003eIMessagePackFormatter\u0026lt;T\u0026gt;\u003c/code\u003e)\u003c/h2\u003e\u003ca id=\"user-content-low-level-api-imessagepackformattert\" class=\"anchor\" aria-label=\"Permalink: Low-Level API (IMessagePackFormatter\u0026lt;T\u0026gt;)\" href=\"#low-level-api-imessagepackformattert\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eIMessagePackFormatter\u0026lt;T\u0026gt;\u003c/code\u003e interface is responsible for serializing a unique type. For example \u003ccode\u003eInt32Formatter : IMessagePackFormatter\u0026lt;Int32\u0026gt;\u003c/code\u003e represents Int32 MessagePack serializer.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public interface IMessagePackFormatter\u0026lt;T\u0026gt;\n{\n void Serialize(ref MessagePackWriter writer, T value, MessagePackSerializerOptions options);\n T Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003einterface\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackWriter\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n T \u003cspan class=\"pl-en\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackReader\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ereader\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMany built-in formatters exists under \u003ccode\u003eMessagePack.Formatters\u003c/code\u003e. Your custom types are usually automatically supported with the built-in type resolvers that generate new \u003ccode\u003eIMessagePackFormatter\u0026lt;T\u0026gt;\u003c/code\u003e types on-the-fly using dynamic code generation. See our \u003ca href=\"#aot\"\u003eAOT code generation\u003c/a\u003e support for platforms that do not support this.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eHowever, some types - especially those provided by third party libraries or the runtime itself - cannot be appropriately annotated, and contractless serialization would produce inefficient or even wrong results.\nTo take more control over the serialization of such custom types, write your own \u003ccode\u003eIMessagePackFormatter\u0026lt;T\u0026gt;\u003c/code\u003e implementation.\nHere is an example of such a custom formatter implementation. Note its use of the primitive API that is described in the next section.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"/// \u0026lt;summary\u0026gt;Serializes a \u0026lt;see cref=\u0026quot;FileInfo\u0026quot; /\u0026gt; by its full path as a string.\u0026lt;/summary\u0026gt;\npublic class FileInfoFormatter : IMessagePackFormatter\u0026lt;FileInfo\u0026gt;\n{\n public void Serialize(\n ref MessagePackWriter writer, FileInfo value, MessagePackSerializerOptions options)\n {\n if (value == null)\n {\n writer.WriteNil();\n return;\n }\n\n writer.WriteString(value.FullName);\n }\n\n public FileInfo Deserialize(\n ref MessagePackReader reader, MessagePackSerializerOptions options)\n {\n if (reader.TryReadNil())\n {\n return null;\n }\n\n options.Security.DepthStep(ref reader);\n\n var path = reader.ReadString();\n\n reader.Depth--;\n return new FileInfo(path);\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e/// \u0026lt;summary\u0026gt;Serializes a \u0026lt;see cref=\"FileInfo\" /\u0026gt; by its full path as a string.\u0026lt;/summary\u0026gt;\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFileInfoFormatter\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eFileInfo\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackWriter\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFileInfo\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e==\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n writer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteNil\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n writer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteString\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003evalue\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eFullName\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e FileInfo \u003cspan class=\"pl-en\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackReader\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ereader\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ereader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eTryReadNil\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n options\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSecurity\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eDepthStep\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e reader\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003epath\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e reader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eReadString\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n reader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDepth\u003cspan class=\"pl-c1\"\u003e--\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e FileInfo\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003epath\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eDepthStep\u003c/code\u003e and \u003ccode\u003eDepth--\u003c/code\u003e statements provide a level of security while deserializing untrusted data\nthat might otherwise be able to execute a denial of service attack by sending MessagePack data that would\ndeserialize into a very deep object graph leading to a \u003ccode\u003eStackOverflowException\u003c/code\u003e that would crash the process.\nThis pair of statements should surround the bulk of any \u003ccode\u003eIMessagePackFormatter\u0026lt;T\u0026gt;.Deserialize\u003c/code\u003e method.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eImportant\u003c/strong\u003e: A message pack formatter must \u003cem\u003eread or write exactly one data structure\u003c/em\u003e.\nIn the above example we just read/write a string. If you have more than one element to write out,\nyou must precede it with a map or array header. You must read the entire map/array when deserializing.\nFor example:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public class MySpecialObjectFormatter : IMessagePackFormatter\u0026lt;MySpecialObject\u0026gt;\n{\n public void Serialize(\n ref MessagePackWriter writer, MySpecialObject value, MessagePackSerializerOptions options)\n {\n if (value == null)\n {\n writer.WriteNil();\n return;\n }\n\n writer.WriteArrayHeader(2);\n writer.WriteString(value.FullName);\n writer.WriteString(value.Age);\n }\n\n public MySpecialObject Deserialize(\n ref MessagePackReader reader, MessagePackSerializerOptions options)\n {\n if (reader.TryReadNil())\n {\n return null;\n }\n\n options.Security.DepthStep(ref reader);\n\n string fullName = null;\n int age = 0;\n\n // Loop over *all* array elements independently of how many we expect,\n // since if we're serializing an older/newer version of this object it might\n // vary in number of elements that were serialized, but the contract of the formatter\n // is that exactly one data structure must be read, regardless.\n // Alternatively, we could check that the size of the array/map is what we expect\n // and throw if it is not.\n int count = reader.ReadArrayHeader();\n for (int i = 0; i \u0026lt; count; i++)\n {\n switch (i)\n {\n case 0:\n fullName = reader.ReadString();\n break;\n case 1:\n age = reader.ReadInt32();\n break;\n default:\n reader.Skip();\n break;\n }\n }\n\n reader.Depth--;\n return new MySpecialObject(fullName, age);\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMySpecialObjectFormatter\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eMySpecialObject\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackWriter\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMySpecialObject\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e==\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n writer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteNil\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n writer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteArrayHeader\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n writer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteString\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003evalue\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eFullName\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n writer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteString\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003evalue\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eAge\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e MySpecialObject \u003cspan class=\"pl-en\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackReader\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ereader\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003ereader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eTryReadNil\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n options\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eSecurity\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eDepthStep\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e reader\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003efullName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eage\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// Loop over *all* array elements independently of how many we expect,\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// since if we're serializing an older/newer version of this object it might\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// vary in number of elements that were serialized, but the contract of the formatter\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// is that exactly one data structure must be read, regardless.\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// Alternatively, we could check that the size of the array/map is what we expect\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// and throw if it is not.\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ecount\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e reader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eReadArrayHeader\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003efor\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ei\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ei\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ecount\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ei\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e++\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eswitch\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003ei\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ecase\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003efullName\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e reader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eReadString\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ebreak\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ecase\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eage\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e reader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eReadInt32\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ebreak\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e\n reader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSkip\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ebreak\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n reader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDepth\u003cspan class=\"pl-c1\"\u003e--\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e MySpecialObject\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003efullName\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e age\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYour custom formatters must be discoverable via some \u003ccode\u003eIFormatterResolver\u003c/code\u003e. Learn more in our \u003ca href=\"#resolvers\"\u003eresolvers\u003c/a\u003e section.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eYou can see many other samples from \u003ca href=\"https://github.com/neuecc/MessagePack-CSharp/tree/master/src/MessagePack/Formatters\"\u003ebuiltin formatters\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePrimitive API (\u003ccode\u003eMessagePackWriter\u003c/code\u003e, \u003ccode\u003eMessagePackReader\u003c/code\u003e)\u003c/h2\u003e\u003ca id=\"user-content-primitive-api-messagepackwriter-messagepackreader\" class=\"anchor\" aria-label=\"Permalink: Primitive API (MessagePackWriter, MessagePackReader)\" href=\"#primitive-api-messagepackwriter-messagepackreader\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eMessagePackWriter\u003c/code\u003e and \u003ccode\u003eMessagePackReader\u003c/code\u003e structs make up the lowest-level API. They read and write the primitives types defined in the MessagePack specification.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eMessagePackReader\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-messagepackreader\" class=\"anchor\" aria-label=\"Permalink: MessagePackReader\" href=\"#messagepackreader\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA \u003ccode\u003eMessagePackReader\u003c/code\u003e can efficiently read from \u003ccode\u003eReadOnlyMemory\u0026lt;byte\u0026gt;\u003c/code\u003e or \u003ccode\u003eReadOnlySequence\u0026lt;byte\u0026gt;\u003c/code\u003e without any allocations, except to allocate a new \u003ccode\u003estring\u003c/code\u003e as required by the \u003ccode\u003eReadString()\u003c/code\u003e method. All other methods return either value structs or \u003ccode\u003eReadOnlySequence\u0026lt;byte\u0026gt;\u003c/code\u003e slices for extensions/arrays.\nReading directly from \u003ccode\u003eReadOnlySequence\u0026lt;byte\u0026gt;\u003c/code\u003e means the reader can directly consume some modern high performance APIs such as \u003ccode\u003ePipeReader\u003c/code\u003e.\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eMethod\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eSkip\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eAdvances the reader's position past the current value. If the value is complex (e.g. map, array) the entire structure is skipped.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eRead*\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eRead and return a value whose type is named by the method name from the current reader position. Throws if the expected type does not match the actual type. When reading numbers, the type need not match the binary-specified type exactly. The numeric value will be coerced into the desired type or throw if the integer type is too small for a large value.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eTryReadNil\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eAdvances beyond the current value if the current value is \u003ccode\u003enil\u003c/code\u003e and returns \u003ccode\u003etrue\u003c/code\u003e; otherwise leaves the reader's position unchanged and returns \u003ccode\u003efalse\u003c/code\u003e.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eReadBytes\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eReturns a slice of the input sequence representing the contents of a \u003ccode\u003ebyte[]\u003c/code\u003e, and advances the reader.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eReadStringSequence\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eReturns a slice of the input sequence representing the contents of a \u003ccode\u003estring\u003c/code\u003e without decoding it, and advances the reader.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eClone\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eCreates a new \u003ccode\u003eMessagePackReader\u003c/code\u003e with the specified input sequence and the same settings as the original reader.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eCreatePeekReader\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eCreates a new reader with the same position as this one, allowing the caller to \"read ahead\" without impacting the original reader's position.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eNextCode\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eReads the low-level MessagePack \u003ccode\u003ebyte\u003c/code\u003e that describes the type of the next value. Does not advance the reader. See \u003ca href=\"https://github.com/msgpack/msgpack/blob/master/spec.md#overview\"\u003eMessagePack format of first byte\u003c/a\u003e. Its static class has \u003ccode\u003eToMessagePackType\u003c/code\u003e and \u003ccode\u003eToFormatName\u003c/code\u003e utility methods. \u003ccode\u003eMessagePackRange\u003c/code\u003e means Min-Max fix range of MessagePack format.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eNextMessagePackType\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eDescribes the \u003ccode\u003eNextCode\u003c/code\u003e value as a higher level category. Does not advance the reader. See \u003ca href=\"https://github.com/msgpack/msgpack/blob/master/spec.md#serialization-type-to-format-conversion\"\u003eMessagePack spec of source types\u003c/a\u003e.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e(others)\u003c/td\u003e\n\u003ctd\u003eOther methods and properties as described by the .xml doc comment file and Intellisense.\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eMessagePackReader\u003c/code\u003e is capable of automatically interpreting both the old and new MessagePack spec.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eMessagePackWriter\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-messagepackwriter\" class=\"anchor\" aria-label=\"Permalink: MessagePackWriter\" href=\"#messagepackwriter\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA \u003ccode\u003eMessagePackWriter\u003c/code\u003e writes to a given instance of \u003ccode\u003eIBufferWriter\u0026lt;byte\u0026gt;\u003c/code\u003e. Several common implementations of this exist, allowing zero allocations and minimal buffer copies while writing directly to several I/O APIs including \u003ccode\u003ePipeWriter\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eMessagePackWriter\u003c/code\u003e writes the new MessagePack spec by default, but can write MessagePack compatible with the old spec by setting the \u003ccode\u003eOldSpec\u003c/code\u003e property to \u003ccode\u003etrue\u003c/code\u003e.\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eMethod\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eClone\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eCreates a new \u003ccode\u003eMessagePackWriter\u003c/code\u003e with the specified underlying \u003ccode\u003eIBufferWriter\u0026lt;byte\u0026gt;\u003c/code\u003e and the same settings as the original writer.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eFlush\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eWrites any buffered bytes to the underlying \u003ccode\u003eIBufferWriter\u0026lt;byte\u0026gt;\u003c/code\u003e.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eWriteNil\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eWrites the MessagePack equivalent of .NET's \u003ccode\u003enull\u003c/code\u003e value.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eWrite\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eWrites any MessagePack primitive value in the most compact form possible. Has overloads for every primitive type defined by the MessagePack spec.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eWrite*IntType*\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eWrites an integer value in exactly the MessagePack type specified, even if a more compact format exists.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eWriteMapHeader\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eIntroduces a map by specifying the number of key=value pairs it contains.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eWriteArrayHeader\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eIntroduces an array by specifying the number of elements it contains.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eWriteExtensionFormat\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eWrites the full content of an extension value including length, type code and content.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eWriteExtensionFormatHeader\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eWrites just the header (length and type code) of an extension value.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eWriteRaw\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eCopies the specified bytes directly to the underlying \u003ccode\u003eIBufferWriter\u0026lt;byte\u0026gt;\u003c/code\u003e without any validation.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e(others)\u003c/td\u003e\n\u003ctd\u003eOther methods and properties as described by the .xml doc comment file and Intellisense.\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eDateTime\u003c/code\u003e is serialized to \u003ca href=\"https://github.com/msgpack/msgpack/blob/master/spec.md#formats-timestamp\"\u003eMessagePack Timestamp format\u003c/a\u003e, it serialize/deserialize UTC and loses \u003ccode\u003eKind\u003c/code\u003e info and requires that \u003ccode\u003eMessagePackWriter.OldSpec == false\u003c/code\u003e.\nIf you use the \u003ccode\u003eNativeDateTimeResolver\u003c/code\u003e, \u003ccode\u003eDateTime\u003c/code\u003e values will be serialized using .NET's native \u003ccode\u003eInt64\u003c/code\u003e representation, which preserves \u003ccode\u003eKind\u003c/code\u003e info but may not be interoperable with non-.NET platforms.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-resolvers\"\u003e\u003c/a\u003eMain Extension Point (\u003ccode\u003eIFormatterResolver\u003c/code\u003e)\u003c/h2\u003e\u003ca id=\"user-content-main-extension-point-iformatterresolver\" class=\"anchor\" aria-label=\"Permalink: Main Extension Point (IFormatterResolver)\" href=\"#main-extension-point-iformatterresolver\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAn \u003ccode\u003eIFormatterResolver\u003c/code\u003e is storage of typed serializers. The \u003ccode\u003eMessagePackSerializer\u003c/code\u003e API accepts a \u003ccode\u003eMessagePackSerializerOptions\u003c/code\u003e object which specifies the \u003ccode\u003eIFormatterResolver\u003c/code\u003e to use, allowing customization of the serialization of complex types.\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eResolver Name\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eBuiltinResolver\u003c/td\u003e\n\u003ctd\u003eBuiltin primitive and standard classes resolver. It includes primitive(int, bool, string...) and there nullable, array and list. and some extra builtin types(\u003ccode\u003eGuid\u003c/code\u003e, \u003ccode\u003eUri\u003c/code\u003e, \u003ccode\u003eBigInteger\u003c/code\u003e, etc...).\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eStandardResolver\u003c/td\u003e\n\u003ctd\u003eComposited resolver. It resolves in the following order \u003ccode\u003ebuiltin -\u0026gt; attribute -\u0026gt; dynamic enum -\u0026gt; dynamic generic -\u0026gt; dynamic union -\u0026gt; dynamic object -\u0026gt; dynamic object fallback\u003c/code\u003e. This is the default of MessagePackSerializer.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eContractlessStandardResolver\u003c/td\u003e\n\u003ctd\u003eComposited \u003ccode\u003eStandardResolver\u003c/code\u003e(except dynamic object fallback) -\u0026gt; \u003ccode\u003eDynamicContractlessObjectResolver\u003c/code\u003e -\u0026gt; \u003ccode\u003eDynamicObjectTypeFallbackResolver\u003c/code\u003e. It enables contractless serialization.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eStandardResolverAllowPrivate\u003c/td\u003e\n\u003ctd\u003eSame as StandardResolver but allow serialize/deserialize private members.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eContractlessStandardResolverAllowPrivate\u003c/td\u003e\n\u003ctd\u003eSame as ContractlessStandardResolver but allow serialize/deserialize private members.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ePrimitiveObjectResolver\u003c/td\u003e\n\u003ctd\u003eMessagePack primitive object resolver. It is used fallback in \u003ccode\u003eobject\u003c/code\u003e type and supports \u003ccode\u003ebool\u003c/code\u003e, \u003ccode\u003echar\u003c/code\u003e, \u003ccode\u003esbyte\u003c/code\u003e, \u003ccode\u003ebyte\u003c/code\u003e, \u003ccode\u003eshort\u003c/code\u003e, \u003ccode\u003eint\u003c/code\u003e, \u003ccode\u003elong\u003c/code\u003e, \u003ccode\u003eushort\u003c/code\u003e, \u003ccode\u003euint\u003c/code\u003e, \u003ccode\u003eulong\u003c/code\u003e, \u003ccode\u003efloat\u003c/code\u003e, \u003ccode\u003edouble\u003c/code\u003e, \u003ccode\u003eDateTime\u003c/code\u003e, \u003ccode\u003estring\u003c/code\u003e, \u003ccode\u003ebyte[]\u003c/code\u003e, \u003ccode\u003eICollection\u003c/code\u003e, \u003ccode\u003eIDictionary\u003c/code\u003e.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDynamicObjectTypeFallbackResolver\u003c/td\u003e\n\u003ctd\u003eSerialize is used type in from \u003ccode\u003eobject\u003c/code\u003e type, deserialize is used PrimitiveObjectResolver.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAttributeFormatterResolver\u003c/td\u003e\n\u003ctd\u003eGet formatter from \u003ccode\u003e[MessagePackFormatter]\u003c/code\u003e attribute.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCompositeResolver\u003c/td\u003e\n\u003ctd\u003eComposes several resolvers and/or formatters together in an ordered list, allowing reuse and overriding of behaviors of existing resolvers and formatters.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eNativeDateTimeResolver\u003c/td\u003e\n\u003ctd\u003eSerialize by .NET native DateTime binary format. It keeps \u003ccode\u003eDateTime.Kind\u003c/code\u003e that loses by standard(MessagePack timestamp) format.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eNativeGuidResolver\u003c/td\u003e\n\u003ctd\u003eSerialize by .NET native Guid binary representation. It is faster than standard(string) representation.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eNativeDecimalResolver\u003c/td\u003e\n\u003ctd\u003eSerialize by .NET native decimal binary representation. It is faster than standard(string) representation.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDynamicEnumResolver\u003c/td\u003e\n\u003ctd\u003eResolver of enum and there nullable, serialize there underlying type. It uses dynamic code generation to avoid boxing and boostup performance serialize there name.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDynamicEnumAsStringResolver\u003c/td\u003e\n\u003ctd\u003eResolver of enum and there nullable. It uses reflection call for resolve nullable at first time.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDynamicGenericResolver\u003c/td\u003e\n\u003ctd\u003eResolver of generic type(\u003ccode\u003eTuple\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eList\u0026lt;\u0026gt;\u003c/code\u003e, \u003ccode\u003eDictionary\u0026lt;,\u0026gt;\u003c/code\u003e, \u003ccode\u003eArray\u003c/code\u003e, etc). It uses reflection call for resolve generic argument at first time.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDynamicUnionResolver\u003c/td\u003e\n\u003ctd\u003eResolver of interface marked by UnionAttribute. It uses dynamic code generation to create dynamic formatter.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDynamicObjectResolver\u003c/td\u003e\n\u003ctd\u003eResolver of class and struct made by MessagePackObjectAttribute. It uses dynamic code generation to create dynamic formatter.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDynamicContractlessObjectResolver\u003c/td\u003e\n\u003ctd\u003eResolver of all classes and structs. It does not needs \u003ccode\u003eMessagePackObjectAttribute\u003c/code\u003e and serialized key as string(same as marked \u003ccode\u003e[MessagePackObject(true)]\u003c/code\u003e).\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDynamicObjectResolverAllowPrivate\u003c/td\u003e\n\u003ctd\u003eSame as DynamicObjectResolver but allow serialize/deserialize private members.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDynamicContractlessObjectResolverAllowPrivate\u003c/td\u003e\n\u003ctd\u003eSame as DynamicContractlessObjectResolver but allow serialize/deserialize private members.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eTypelessObjectResolver\u003c/td\u003e\n\u003ctd\u003eUsed for \u003ccode\u003eobject\u003c/code\u003e, embed .NET type in binary by \u003ccode\u003eext(100)\u003c/code\u003e format so no need to pass type in deserialization.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eTypelessContractlessStandardResolver\u003c/td\u003e\n\u003ctd\u003eComposited resolver. It resolves in the following order \u003ccode\u003enativedatetime -\u0026gt; builtin -\u0026gt; attribute -\u0026gt; dynamic enum -\u0026gt; dynamic generic -\u0026gt; dynamic union -\u0026gt; dynamic object -\u0026gt; dynamiccontractless -\u0026gt; typeless\u003c/code\u003e. This is the default of \u003ccode\u003eMessagePackSerializer.Typeless\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eEach instance of \u003ccode\u003eMessagePackSerializer\u003c/code\u003e accepts only a single resolver. Most object graphs will need more than one for serialization, so composing a single resolver made up of several is often required, and can be done with the \u003ccode\u003eCompositeResolver\u003c/code\u003e as shown below:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// Do this once and store it for reuse.\nvar resolver = MessagePack.Resolvers.CompositeResolver.Create(\n // resolver custom types first\n ReactivePropertyResolver.Instance,\n MessagePack.Unity.Extension.UnityBlitResolver.Instance,\n MessagePack.Unity.UnityResolver.Instance,\n\n // finally use standard resolver\n StandardResolver.Instance\n);\nvar options = MessagePackSerializerOptions.Standard.WithResolver(resolver);\n\n// Each time you serialize/deserialize, specify the options:\nbyte[] msgpackBytes = MessagePackSerializer.Serialize(myObject, options);\nT myObject2 = MessagePackSerializer.Deserialize\u0026lt;MyObject\u0026gt;(msgpackBytes, options);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e// Do this once and store it for reuse.\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresolver\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eCompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eCreate\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// resolver custom types first\u003c/span\u003e\n ReactivePropertyResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnity\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eExtension\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnityBlitResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnity\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnityResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// finally use standard resolver\u003c/span\u003e\n StandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\n\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializerOptions\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandard\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWithResolver\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eresolver\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// Each time you serialize/deserialize, specify the options:\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003ebyte\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003emsgpackBytes\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003emyObject\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e options\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003emyObject2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eMyObject\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003emsgpackBytes\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e options\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA resolver can be set as default with \u003ccode\u003eMessagePackSerializer.DefaultOptions = options\u003c/code\u003e, but \u003cstrong\u003eWARNING\u003c/strong\u003e:\nWhen developing an application where you control all MessagePack-related code it may be safe to rely on this mutable static to control behavior.\nFor all other libraries or multi-purpose applications that use \u003ccode\u003eMessagePackSerializer\u003c/code\u003e you should explicitly specify the \u003ccode\u003eMessagePackSerializerOptions\u003c/code\u003e to use with each method invocation to guarantee your code behaves as you expect even when sharing an \u003ccode\u003eAppDomain\u003c/code\u003e or process with other MessagePack users that may change this static property.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eHere is sample of use \u003ccode\u003eDynamicEnumAsStringResolver\u003c/code\u003e with \u003ccode\u003eDynamicContractlessObjectResolver\u003c/code\u003e (It is Json.NET-like lightweight setting.)\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// composite same as StandardResolver\nvar resolver = MessagePack.Resolvers.CompositeResolver.Create(\n MessagePack.Resolvers.BuiltinResolver.Instance,\n MessagePack.Resolvers.AttributeFormatterResolver.Instance,\n\n // replace enum resolver\n MessagePack.Resolvers.DynamicEnumAsStringResolver.Instance,\n\n MessagePack.Resolvers.DynamicGenericResolver.Instance,\n MessagePack.Resolvers.DynamicUnionResolver.Instance,\n MessagePack.Resolvers.DynamicObjectResolver.Instance,\n\n MessagePack.Resolvers.PrimitiveObjectResolver.Instance,\n\n // final fallback(last priority)\n MessagePack.Resolvers.DynamicContractlessObjectResolver.Instance\n);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e// composite same as StandardResolver\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresolver\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eCompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eCreate\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eBuiltinResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eAttributeFormatterResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// replace enum resolver\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDynamicEnumAsStringResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDynamicGenericResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDynamicUnionResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDynamicObjectResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003ePrimitiveObjectResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// final fallback(last priority)\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDynamicContractlessObjectResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\n\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you want to make an extension package, you should write both a formatter and resolver\nfor easier consumption.\nHere is sample of a resolver:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"public class SampleCustomResolver : IFormatterResolver\n{\n // Resolver should be singleton.\n public static readonly IFormatterResolver Instance = new SampleCustomResolver();\n\n private SampleCustomResolver()\n {\n }\n\n // GetFormatter\u0026lt;T\u0026gt;'s get cost should be minimized so use type cache.\n public IMessagePackFormatter\u0026lt;T\u0026gt; GetFormatter\u0026lt;T\u0026gt;()\n {\n return FormatterCache\u0026lt;T\u0026gt;.Formatter;\n }\n\n private static class FormatterCache\u0026lt;T\u0026gt;\n {\n public static readonly IMessagePackFormatter\u0026lt;T\u0026gt; Formatter;\n\n // generic's static constructor should be minimized for reduce type generation size!\n // use outer helper method.\n static FormatterCache()\n {\n Formatter = (IMessagePackFormatter\u0026lt;T\u0026gt;)SampleCustomResolverGetFormatterHelper.GetFormatter(typeof(T));\n }\n }\n}\n\ninternal static class SampleCustomResolverGetFormatterHelper\n{\n // If type is concrete type, use type-formatter map\n static readonly Dictionary\u0026lt;Type, object\u0026gt; formatterMap = new Dictionary\u0026lt;Type, object\u0026gt;()\n {\n {typeof(FileInfo), new FileInfoFormatter()}\n // add more your own custom serializers.\n };\n\n internal static object GetFormatter(Type t)\n {\n object formatter;\n if (formatterMap.TryGetValue(t, out formatter))\n {\n return formatter;\n }\n\n // If type can not get, must return null for fallback mechanism.\n return null;\n }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSampleCustomResolver\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIFormatterResolver\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// Resolver should be singleton.\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereadonly\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIFormatterResolver\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eInstance\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e SampleCustomResolver\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003eprivate\u003c/span\u003e \u003cspan class=\"pl-v\"\u003eSampleCustomResolver\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// GetFormatter\u0026lt;T\u0026gt;'s get cost should be minimized so use type cache.\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eGetFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFormatterCache\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eFormatter\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003eprivate\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eFormatterCache\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereadonly\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eFormatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// generic's static constructor should be minimized for reduce type generation size!\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// use outer helper method.\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-v\"\u003eFormatterCache\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eFormatter\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003eSampleCustomResolverGetFormatterHelper\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eGetFormatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eT\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003einternal\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eSampleCustomResolverGetFormatterHelper\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// If type is concrete type, use type-formatter map\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003ereadonly\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eDictionary\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eType\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eobject\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eformatterMap\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eDictionary\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eType\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eobject\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eFileInfo\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e FileInfoFormatter\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// add more your own custom serializers.\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003einternal\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eobject\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eGetFormatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eType\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003et\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003eobject\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eformatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eformatterMap\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eTryGetValue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003et\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eout\u003c/span\u003e formatter\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eformatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// If type can not get, must return null for fallback mechanism.\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMessagePackFormatterAttribute\u003c/h2\u003e\u003ca id=\"user-content-messagepackformatterattribute\" class=\"anchor\" aria-label=\"Permalink: MessagePackFormatterAttribute\" href=\"#messagepackformatterattribute\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePackFormatterAttribute is a lightweight extension point of class, struct, interface, enum and property/field. This is like Json.NET's JsonConverterAttribute. For example, serialize private field, serialize x10 formatter.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[MessagePackFormatter(typeof(CustomObjectFormatter))]\npublic class CustomObject\n{\n string internalId;\n\n public CustomObject()\n {\n this.internalId = Guid.NewGuid().ToString();\n }\n\n // serialize/deserialize internal field.\n class CustomObjectFormatter : IMessagePackFormatter\u0026lt;CustomObject\u0026gt;\n {\n public void Serialize(ref MessagePackWriter writer, CustomObject value, MessagePackSerializerOptions options)\n {\n options.Resolver.GetFormatterWithVerify\u0026lt;string\u0026gt;().Serialize(ref writer, value.internalId, options);\n }\n\n public CustomObject Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)\n {\n var id = options.Resolver.GetFormatterWithVerify\u0026lt;string\u0026gt;().Deserialize(ref reader, options);\n return new CustomObject { internalId = id };\n }\n }\n}\n\n// per field, member\n\npublic class Int_x10Formatter : IMessagePackFormatter\u0026lt;int\u0026gt;\n{\n public int Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)\n {\n return reader.ReadInt32() * 10;\n }\n\n public void Serialize(ref MessagePackWriter writer, int value, MessagePackSerializerOptions options)\n {\n writer.WriteInt32(value * 10);\n }\n}\n\n[MessagePackObject]\npublic class MyClass\n{\n // You can attach custom formatter per member.\n [Key(0)]\n [MessagePackFormatter(typeof(Int_x10Formatter))]\n public int MyProperty1 { get; set; }\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackFormatter\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eCustomObjectFormatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eCustomObject\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003einternalId\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-v\"\u003eCustomObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ethis\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003einternalId \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e Guid\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eNewGuid\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eToString\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e// serialize/deserialize internal field.\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eCustomObjectFormatter\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eCustomObject\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackWriter\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eCustomObject\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n options\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eGetFormatterWithVerify\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e writer\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e value\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003einternalId\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e options\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e CustomObject \u003cspan class=\"pl-en\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackReader\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ereader\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eid\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e options\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eGetFormatterWithVerify\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003estring\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e reader\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e options\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e CustomObject \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003einternalId\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eid\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e// per field, member\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eInt_x10Formatter\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e:\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIMessagePackFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eDeserialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackReader\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ereader\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e reader\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eReadInt32\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e10\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eSerialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003eref\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackWriter\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ewriter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMessagePackSerializerOptions\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n writer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWriteInt32\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003evalue\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e10\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackObject\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eMyClass\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// You can attach custom formatter per member.\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eKey\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eMessagePackFormatter\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-k\"\u003etypeof\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eInt_x10Formatter\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eMyProperty1\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eget\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFormatter is retrieved by \u003ccode\u003eAttributeFormatterResolver\u003c/code\u003e, it is included in \u003ccode\u003eStandardResolver\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eIgnoreFormatter\u003c/h2\u003e\u003ca id=\"user-content-ignoreformatter\" class=\"anchor\" aria-label=\"Permalink: IgnoreFormatter\" href=\"#ignoreformatter\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eIgnoreFormatter\u0026lt;T\u0026gt;\u003c/code\u003e is lightweight extension point of class and struct. If there exists types that can't be serialized, you can register \u003ccode\u003eIgnoreFormatter\u0026lt;T\u0026gt;\u003c/code\u003e that serializes those to nil/null.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// CompositeResolver can set custom formatter.\nvar resolver = MessagePack.Resolvers.CompositeResolver.Create(\n new IMessagePackFormatter[]\n {\n // for example, register reflection infos (can not serialize)\n new IgnoreFormatter\u0026lt;MethodBase\u0026gt;(),\n new IgnoreFormatter\u0026lt;MethodInfo\u0026gt;(),\n new IgnoreFormatter\u0026lt;PropertyInfo\u0026gt;(),\n new IgnoreFormatter\u0026lt;FieldInfo\u0026gt;()\n },\n new IFormatterResolver[]\n {\n ContractlessStandardResolver.Instance\n });\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e// CompositeResolver can set custom formatter.\u003c/span\u003e\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eresolver\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eCompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eCreate\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e IMessagePackFormatter\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e// for example, register reflection infos (can not serialize)\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIgnoreFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eMethodBase\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIgnoreFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eMethodInfo\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIgnoreFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003ePropertyInfo\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eIgnoreFormatter\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003eFieldInfo\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e\u0026gt;\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e IFormatterResolver\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n ContractlessStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eReserved Extension Types\u003c/h2\u003e\u003ca id=\"user-content-reserved-extension-types\" class=\"anchor\" aria-label=\"Permalink: Reserved Extension Types\" href=\"#reserved-extension-types\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# already used some MessagePack extension type codes, be careful to avoid using the same ext code for other purposes.\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eRange\u003c/th\u003e\n\u003cth\u003eReserved for\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e[-128, -1]\u003c/td\u003e\n\u003ctd\u003eReserved by the msgpack spec for predefined types\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e[30, 120)\u003c/td\u003e\n\u003ctd\u003eReserved for this library's use to support common types in .NET\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eThis leaves the following ranges for your use:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e[0, 30)\u003c/li\u003e\n\u003cli\u003e[120, 127]\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eWithin the \u003cem\u003ereserved\u003c/em\u003e ranges, this library defines or implements extensions that use these type codes:\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eCode\u003c/th\u003e\n\u003cth\u003eType\u003c/th\u003e\n\u003cth\u003eUse by\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e-1\u003c/td\u003e\n\u003ctd\u003eDateTime\u003c/td\u003e\n\u003ctd\u003eMessagePack-spec reserved for timestamp\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e30\u003c/td\u003e\n\u003ctd\u003eVector2[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e31\u003c/td\u003e\n\u003ctd\u003eVector3[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e32\u003c/td\u003e\n\u003ctd\u003eVector4[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e33\u003c/td\u003e\n\u003ctd\u003eQuaternion[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e34\u003c/td\u003e\n\u003ctd\u003eColor[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e35\u003c/td\u003e\n\u003ctd\u003eBounds[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e36\u003c/td\u003e\n\u003ctd\u003eRect[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e37\u003c/td\u003e\n\u003ctd\u003eInt[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e38\u003c/td\u003e\n\u003ctd\u003eFloat[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e39\u003c/td\u003e\n\u003ctd\u003eDouble[]\u003c/td\u003e\n\u003ctd\u003efor Unity, UnsafeBlitFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e98\u003c/td\u003e\n\u003ctd\u003eAll\u003c/td\u003e\n\u003ctd\u003eMessagePackCompression.Lz4BlockArray\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e99\u003c/td\u003e\n\u003ctd\u003eAll\u003c/td\u003e\n\u003ctd\u003eMessagePackCompression.Lz4Block\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e100\u003c/td\u003e\n\u003ctd\u003eobject\u003c/td\u003e\n\u003ctd\u003eTypelessFormatter\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUnity support\u003c/h2\u003e\u003ca id=\"user-content-unity-support\" class=\"anchor\" aria-label=\"Permalink: Unity support\" href=\"#unity-support\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eUnity lowest supported version is \u003ccode\u003e2018.3\u003c/code\u003e, API Compatibility Level supports both \u003ccode\u003e.NET 4.x\u003c/code\u003e and \u003ccode\u003e.NET Standard 2.0\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eYou can install the \u003ccode\u003eunitypackage\u003c/code\u003e from the \u003ca href=\"https://github.com/MessagePack-CSharp/MessagePack-CSharp/releases\"\u003eReleases\u003c/a\u003e page.\nIf your build targets .NET Framework 4.x and runs on mono, you can use it as is.\nBut if your build targets IL2CPP, you can not use \u003ccode\u003eDynamic***Resolver\u003c/code\u003e, so it is required to use pre-code generation. Please see \u003ca href=\"#aot\"\u003epre-code generation section\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# includes some additional \u003ccode\u003eSystem.*.dll\u003c/code\u003e libraries that originally provides in NuGet. They are located under \u003ccode\u003ePlugins\u003c/code\u003e. If other packages use these libraries (e.g. Unity Collections package using \u003ccode\u003eSystem.Runtime.CompilerServices.Unsafe.dll\u003c/code\u003e), to avoid conflicts, please delete the DLL under \u003ccode\u003ePlugins\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eCurrently \u003ccode\u003eCompositeResolver.Create\u003c/code\u003e does not work on IL2CPP, so it is recommended to use \u003ccode\u003eStaticCompositeResolver.Instance.Register\u003c/code\u003e instead.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIn Unity, MessagePackSerializer can serialize \u003ccode\u003eVector2\u003c/code\u003e, \u003ccode\u003eVector3\u003c/code\u003e, \u003ccode\u003eVector4\u003c/code\u003e, \u003ccode\u003eQuaternion\u003c/code\u003e, \u003ccode\u003eColor\u003c/code\u003e, \u003ccode\u003eBounds\u003c/code\u003e, \u003ccode\u003eRect\u003c/code\u003e, \u003ccode\u003eAnimationCurve\u003c/code\u003e, \u003ccode\u003eKeyframe\u003c/code\u003e, \u003ccode\u003eMatrix4x4\u003c/code\u003e, \u003ccode\u003eGradient\u003c/code\u003e, \u003ccode\u003eColor32\u003c/code\u003e, \u003ccode\u003eRectOffset\u003c/code\u003e, \u003ccode\u003eLayerMask\u003c/code\u003e, \u003ccode\u003eVector2Int\u003c/code\u003e, \u003ccode\u003eVector3Int\u003c/code\u003e, \u003ccode\u003eRangeInt\u003c/code\u003e, \u003ccode\u003eRectInt\u003c/code\u003e, \u003ccode\u003eBoundsInt\u003c/code\u003e and their nullable, array and list types with the built-in extension \u003ccode\u003eUnityResolver\u003c/code\u003e. It is included in StandardResolver by default.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eMessagePack for C# has an additional unsafe extension. \u003ccode\u003eUnsafeBlitResolver\u003c/code\u003e is special resolver for extremely fast but unsafe serialization/deserialization of struct arrays.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://cloud.githubusercontent.com/assets/46207/23837633/76589924-07ce-11e7-8b26-e50eab548938.png\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/46207/23837633/76589924-07ce-11e7-8b26-e50eab548938.png\" alt=\"image\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ex20 faster Vector3[] serialization than native JsonUtility. If use \u003ccode\u003eUnsafeBlitResolver\u003c/code\u003e, serialization uses a special format (ext:typecode 30~39) for \u003ccode\u003eVector2[]\u003c/code\u003e, \u003ccode\u003eVector3[]\u003c/code\u003e, \u003ccode\u003eQuaternion[]\u003c/code\u003e, \u003ccode\u003eColor[]\u003c/code\u003e, \u003ccode\u003eBounds[]\u003c/code\u003e, \u003ccode\u003eRect[]\u003c/code\u003e. If use \u003ccode\u003eUnityBlitWithPrimitiveArrayResolver\u003c/code\u003e, it supports \u003ccode\u003eint[]\u003c/code\u003e, \u003ccode\u003efloat[]\u003c/code\u003e, \u003ccode\u003edouble[]\u003c/code\u003e too. This special feature is useful for serializing Mesh (many \u003ccode\u003eVector3[]\u003c/code\u003e) or many transform positions.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you want to use unsafe resolver, register \u003ccode\u003eUnityBlitResolver\u003c/code\u003e or \u003ccode\u003eUnityBlitWithPrimitiveArrayResolver\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eHere is sample of configuration.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"StaticCompositeResolver.Instance.Register(\n MessagePack.Unity.UnityResolver.Instance,\n MessagePack.Unity.Extension.UnityBlitWithPrimitiveArrayResolver.Instance,\n MessagePack.Resolvers.StandardResolver.Instance\n);\n\nvar options = MessagePackSerializerOptions.Standard.WithResolver(StaticCompositeResolver.Instance);\nMessagePackSerializer.DefaultOptions = options;\"\u003e\u003cpre\u003eStaticCompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eRegister\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnity\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnityResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnity\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eExtension\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eUnityBlitWithPrimitiveArrayResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\n\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializerOptions\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandard\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWithResolver\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eStaticCompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\nMessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDefaultOptions \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoptions\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eMessagePack.UnityShims\u003c/code\u003e NuGet package is for .NET server-side serialization support to communicate with Unity. It includes shims for Vector3 etc and the Safe/Unsafe serialization extension.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you want to share a class between Unity and a server, you can use \u003ccode\u003eSharedProject\u003c/code\u003e or \u003ccode\u003eReference as Link\u003c/code\u003e or a glob reference (with \u003ccode\u003eLinkBase\u003c/code\u003e), etc. Anyway, you need to share at source-code level. This is a sample project structure using a glob reference (recommended).\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eServerProject(.NET Framework 4.6/.NET/.NET Standard)\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e[\u003ccode\u003e\u0026lt;Compile Include=\"..\\UnityProject\\Assets\\Scripts\\Shared\\**\\*.cs\" LinkBase=\"Shared\" /\u0026gt;\u003c/code\u003e]\u003c/li\u003e\n\u003cli\u003e[MessagePack]\u003c/li\u003e\n\u003cli\u003e[MessagePack.UnityShims]\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eUnityProject\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e[Concrete SharedCodes]\u003c/li\u003e\n\u003cli\u003e[MessagePack](not dll/NuGet, use MessagePack.Unity.unitypackage's sourcecode)\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-aot\"\u003e\u003c/a\u003eAOT Code Generation (support for Unity/Xamarin)\u003c/h2\u003e\u003ca id=\"user-content-aot-code-generation-support-for-unityxamarin\" class=\"anchor\" aria-label=\"Permalink: AOT Code Generation (support for Unity/Xamarin)\" href=\"#aot-code-generation-support-for-unityxamarin\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBy default, MessagePack for C# serializes custom objects by \u003ca href=\"https://msdn.microsoft.com/en-us/library/system.reflection.emit.ilgenerator.aspx\" rel=\"nofollow\"\u003egenerating IL\u003c/a\u003e on the fly at runtime to create custom, highly tuned formatters for each type. This code generation has a minor upfront performance cost.\nBecause strict-AOT environments such as Xamarin and Unity IL2CPP forbid runtime code generation, MessagePack provides a way for you to run a code generator ahead of time as well.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003eNote: When using Unity, dynamic code generation only works when targeting .NET Framework 4.x + mono runtime.\nFor all other Unity targets, AOT is required.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp dir=\"auto\"\u003eIf you want to avoid the upfront dynamic generation cost or you need to run on Xamarin or Unity, you need AOT code generation. \u003ccode\u003empc\u003c/code\u003e (MessagePackCompiler) is the code generator of MessagePack for C#. mpc uses \u003ca href=\"https://github.com/dotnet/roslyn\"\u003eRoslyn\u003c/a\u003e to analyze source code.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFirst of all, mpc requires \u003ca href=\"https://dotnet.microsoft.com/download\" rel=\"nofollow\"\u003e.NET 6+ Runtime\u003c/a\u003e. The easiest way to acquire and run mpc is as a dotnet tool.\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"dotnet tool install --global MessagePack.Generator\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003edotnet tool install --global MessagePack.Generator\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eInstalling it as a local tool allows you to include the tools and versions that you use in your source control system. Run these commands in the root of your repo:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"dotnet new tool-manifest\ndotnet tool install MessagePack.Generator\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003edotnet new tool-manifest\ndotnet tool install MessagePack.Generator\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eCheck in your \u003ccode\u003e.config\\dotnet-tools.json\u003c/code\u003e file. On another machine you can \"restore\" your tool using the \u003ccode\u003edotnet tool restore\u003c/code\u003e command.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eOnce you have the tool installed, simply invoke using \u003ccode\u003edotnet mpc\u003c/code\u003e within your repo:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"dotnet mpc --help\n\nUsage: mpc [options...]\n\nOptions:\n -i, -input \u0026lt;String\u0026gt; Input path to MSBuild project file or the directory containing Unity source files. (Required)\n -o, -output \u0026lt;String\u0026gt; Output file path(.cs) or directory(multiple generate file). (Required)\n -c, -conditionalSymbol \u0026lt;String\u0026gt; Conditional compiler symbols, split with ','. (Default: null)\n -r, -resolverName \u0026lt;String\u0026gt; Set resolver name. (Default: GeneratedResolver)\n -n, -namespace \u0026lt;String\u0026gt; Set namespace root name. (Default: MessagePack)\n -m, -useMapMode \u0026lt;Boolean\u0026gt; Force use map mode serialization. (Default: False)\n -ms, -multipleIfDirectiveOutputSymbols \u0026lt;String\u0026gt; Generate #if-- files by symbols, split with ','. (Default: null)\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003edotnet mpc --help\n\nUsage: mpc [options...]\n\nOptions:\n -i, -input \u0026lt;String\u0026gt; Input path to MSBuild project file or the directory containing Unity source files. (Required)\n -o, -output \u0026lt;String\u0026gt; Output file path(.cs) or directory(multiple generate file). (Required)\n -c, -conditionalSymbol \u0026lt;String\u0026gt; Conditional compiler symbols, split with ','. (Default: null)\n -r, -resolverName \u0026lt;String\u0026gt; Set resolver name. (Default: GeneratedResolver)\n -n, -namespace \u0026lt;String\u0026gt; Set namespace root name. (Default: MessagePack)\n -m, -useMapMode \u0026lt;Boolean\u0026gt; Force use map mode serialization. (Default: False)\n -ms, -multipleIfDirectiveOutputSymbols \u0026lt;String\u0026gt; Generate #if-- files by symbols, split with ','. (Default: null)\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003empc\u003c/code\u003e targets C# code with \u003ccode\u003e[MessagePackObject]\u003c/code\u003e or \u003ccode\u003e[Union]\u003c/code\u003e annotations.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-batchfile notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// Simple Sample:\ndotnet mpc -i \u0026quot;..\\src\\Sandbox.Shared.csproj\u0026quot; -o \u0026quot;MessagePackGenerated.cs\u0026quot;\n\n// Use force map simulate DynamicContractlessObjectResolver\ndotnet mpc -i \u0026quot;..\\src\\Sandbox.Shared.csproj\u0026quot; -o \u0026quot;MessagePackGenerated.cs\u0026quot; -m\"\u003e\u003cpre\u003e// Simple Sample:\ndotnet mpc -i \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e..\\src\\Sandbox.Shared.csproj\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e -o \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eMessagePackGenerated.cs\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\n\n// Use force map simulate DynamicContractlessObjectResolver\ndotnet mpc -i \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e..\\src\\Sandbox.Shared.csproj\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e -o \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eMessagePackGenerated.cs\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e -m\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBy default, \u003ccode\u003empc\u003c/code\u003e generates the resolver as \u003ccode\u003eMessagePack.Resolvers.GeneratedResolver\u003c/code\u003e and formatters as\u003ccode\u003eMessagePack.Formatters.*\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eHere is the full sample code to register a generated resolver in Unity.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cs notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using MessagePack;\nusing MessagePack.Resolvers;\nusing UnityEngine;\n\npublic class Startup\n{\n static bool serializerRegistered = false;\n\n [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]\n static void Initialize()\n {\n if (!serializerRegistered)\n {\n StaticCompositeResolver.Instance.Register(\n MessagePack.Resolvers.GeneratedResolver.Instance,\n MessagePack.Resolvers.StandardResolver.Instance\n );\n\n var option = MessagePackSerializerOptions.Standard.WithResolver(StaticCompositeResolver.Instance);\n\n MessagePackSerializer.DefaultOptions = option;\n serializerRegistered = true;\n }\n }\n\n#if UNITY_EDITOR\n\n\n [UnityEditor.InitializeOnLoadMethod]\n static void EditorInitialize()\n {\n Initialize();\n }\n\n#endif\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e UnityEngine\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eStartup\u003c/span\u003e\n\u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eserializerRegistered\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eRuntimeInitializeOnLoadMethod\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eRuntimeInitializeLoadType\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eBeforeSceneLoad\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eInitialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e \u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e!\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003eserializerRegistered\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n StaticCompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eRegister\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eGeneratedResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e\n MessagePack\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eResolvers\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandardResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\n \u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n \u003cspan class=\"pl-smi\"\u003evar\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoption\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e MessagePackSerializerOptions\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eStandard\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eWithResolver\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003eStaticCompositeResolver\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInstance\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n\n MessagePackSerializer\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eDefaultOptions \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003eoption\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-s1\"\u003eserializerRegistered\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n#\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e UNITY_EDITOR\n\n\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003eUnityEditor\u003cspan class=\"pl-kos\"\u003e.\u003c/span\u003eInitializeOnLoadMethod\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003e\u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eEditorInitialize\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\n Initialize\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e;\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n\n#endif\n\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIn Unity, you can use MessagePack CodeGen windows at \u003ccode\u003eWindows -\u0026gt; MessagePack -\u0026gt; CodeGenerator\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://user-images.githubusercontent.com/46207/69414381-f14da400-0d55-11ea-9f8d-9af448d347dc.png\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/46207/69414381-f14da400-0d55-11ea-9f8d-9af448d347dc.png\" alt=\"\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eInstall the .NET runtime, install mpc (as a .NET Tool as described above), and execute \u003ccode\u003edotnet mpc\u003c/code\u003e. Currently this tool is experimental so please tell me your opinion.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIn Xamarin, you can install the \u003ca href=\"/MessagePack-CSharp/MessagePack-CSharp/blob/master/doc/msbuildtask.md\"\u003ethe \u003ccode\u003eMessagePack.MSBuild.Tasks\u003c/code\u003e NuGet package\u003c/a\u003e into your projects to pre-compile fast serialization code and run in environments where JIT compilation is not allowed.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eRPC\u003c/h2\u003e\u003ca id=\"user-content-rpc\" class=\"anchor\" aria-label=\"Permalink: RPC\" href=\"#rpc\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eMessagePack advocated \u003ca href=\"https://github.com/msgpack-rpc/msgpack-rpc\"\u003eMessagePack RPC\u003c/a\u003e, but work on it has stopped and it is not widely used.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMagicOnion\u003c/h3\u003e\u003ca id=\"user-content-magiconion\" class=\"anchor\" aria-label=\"Permalink: MagicOnion\" href=\"#magiconion\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eI've created a gRPC based MessagePack HTTP/2 RPC streaming framework called \u003ca href=\"https://github.com/Cysharp/MagicOnion\"\u003eMagicOnion\u003c/a\u003e. gRPC usually communicates with Protocol Buffers using IDL. But MagicOnion uses MessagePack for C# and does not need IDL. When communicating C# to C#, schemaless (or rather C# classes as schema) is better than using IDL.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eStreamJsonRpc\u003c/h3\u003e\u003ca id=\"user-content-streamjsonrpc\" class=\"anchor\" aria-label=\"Permalink: StreamJsonRpc\" href=\"#streamjsonrpc\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe StreamJsonRpc library is based on \u003ca href=\"https://www.jsonrpc.org/\" rel=\"nofollow\"\u003eJSON-RPC\u003c/a\u003e and includes \u003ca href=\"https://github.com/microsoft/vs-streamjsonrpc/blob/master/doc/extensibility.md#alternative-formatters\"\u003ea pluggable formatter architecture\u003c/a\u003e and as of v2.3 includes \u003ca href=\"https://github.com/microsoft/vs-streamjsonrpc/blob/master/doc/extensibility.md#message-formatterss\"\u003eMessagePack support\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eHow to build\u003c/h2\u003e\u003ca id=\"user-content-how-to-build\" class=\"anchor\" aria-label=\"Permalink: How to build\" href=\"#how-to-build\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSee our \u003ca href=\"/MessagePack-CSharp/MessagePack-CSharp/blob/master/CONTRIBUTING.md\"\u003econtributor's guide\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-coc\"\u003e\u003c/a\u003eCode of Conduct\u003c/h2\u003e\u003ca id=\"user-content-code-of-conduct\" class=\"anchor\" aria-label=\"Permalink: Code of Conduct\" href=\"#code-of-conduct\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.\nFor more information see the \u003ca href=\"https://dotnetfoundation.org/code-of-conduct\" rel=\"nofollow\"\u003e.NET Foundation Code of Conduct\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e.NET Foundation\u003c/h2\u003e\u003ca id=\"user-content-net-foundation\" class=\"anchor\" aria-label=\"Permalink: .NET Foundation\" href=\"#net-foundation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis project is supported by the \u003ca href=\"https://dotnetfoundation.org\" rel=\"nofollow\"\u003e.NET Foundation\u003c/a\u003e.\u003c/p\u003e\n\u003c/article\u003e","loaded":true,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":[{"level":1,"text":"MessagePack for C# (.NET Framework, .NET 6, Unity, Xamarin)","anchor":"messagepack-for-c-net-framework-net-6-unity-xamarin","htmlText":"MessagePack for C# (.NET Framework, .NET 6, Unity, Xamarin)"},{"level":2,"text":"Table of Contents","anchor":"table-of-contents","htmlText":"Table of Contents"},{"level":2,"text":"Installation","anchor":"installation","htmlText":"Installation"},{"level":3,"text":"NuGet packages","anchor":"nuget-packages","htmlText":"NuGet packages"},{"level":3,"text":"Unity","anchor":"unity","htmlText":"Unity"},{"level":3,"text":"Migration notes from v1.x","anchor":"migration-notes-from-v1x","htmlText":"Migration notes from v1.x"},{"level":2,"text":"Quick Start","anchor":"quick-start","htmlText":"Quick Start"},{"level":2,"text":"Analyzer","anchor":"analyzer","htmlText":"Analyzer"},{"level":2,"text":"Built-in supported types","anchor":"built-in-supported-types","htmlText":"Built-in supported types"},{"level":2,"text":"Object Serialization","anchor":"object-serialization","htmlText":"Object Serialization"},{"level":2,"text":"DataContract compatibility","anchor":"datacontract-compatibility","htmlText":"DataContract compatibility"},{"level":2,"text":"Serializing readonly/immutable object members (SerializationConstructor)","anchor":"serializing-readonlyimmutable-object-members--serializationconstructor","htmlText":"Serializing readonly/immutable object members (SerializationConstructor)"},{"level":3,"text":"C# 9 record types","anchor":"c-9-record-types","htmlText":"C# 9 record types"},{"level":3,"text":"C# 9 init property setter limitations","anchor":"c-9-init-property-setter-limitations","htmlText":"C# 9 init property setter limitations"},{"level":2,"text":"Serialization Callback","anchor":"serialization-callback","htmlText":"Serialization Callback"},{"level":2,"text":"Union","anchor":"union","htmlText":"Union"},{"level":2,"text":"Dynamic (Untyped) Deserialization","anchor":"dynamic-untyped-deserialization","htmlText":"Dynamic (Untyped) Deserialization"},{"level":2,"text":"Object Type Serialization","anchor":"object-type-serialization","htmlText":"Object Type Serialization"},{"level":2,"text":"Typeless","anchor":"typeless","htmlText":"Typeless"},{"level":2,"text":"Security","anchor":"security","htmlText":"Security"},{"level":2,"text":"Performance","anchor":"performance","htmlText":"Performance"},{"level":3,"text":"Deserialization Performance for different options","anchor":"deserialization-performance-for-different-options","htmlText":"Deserialization Performance for different options"},{"level":3,"text":"String interning","anchor":"string-interning","htmlText":"String interning"},{"level":2,"text":"LZ4 Compression","anchor":"lz4-compression","htmlText":"LZ4 Compression"},{"level":3,"text":"Attributions","anchor":"attributions","htmlText":"Attributions"},{"level":2,"text":"Comparison with protobuf, JSON, ZeroFormatter","anchor":"comparison-with-protobuf-json-zeroformatter","htmlText":"Comparison with protobuf, JSON, ZeroFormatter"},{"level":2,"text":"Hints to achieve maximum performance when using MessagePack for C#","anchor":"hints-to-achieve-maximum-performance-when-using-messagepack-for-c","htmlText":"Hints to achieve maximum performance when using MessagePack for C#"},{"level":3,"text":"Use indexed keys instead of string keys (Contractless)","anchor":"use-indexed-keys-instead-of-string-keys-contractless","htmlText":"Use indexed keys instead of string keys (Contractless)"},{"level":3,"text":"Create own custom composite resolver","anchor":"create-own-custom-composite-resolver","htmlText":"Create own custom composite resolver"},{"level":3,"text":"Use native resolvers","anchor":"use-native-resolvers","htmlText":"Use native resolvers"},{"level":3,"text":"Be careful when copying buffers","anchor":"be-careful-when-copying-buffers","htmlText":"Be careful when copying buffers"},{"level":3,"text":"Choosing compression","anchor":"choosing-compression","htmlText":"Choosing compression"},{"level":2,"text":"Extensions","anchor":"extensions","htmlText":"Extensions"},{"level":2,"text":"Experimental Features","anchor":"experimental-features","htmlText":"Experimental Features"},{"level":1,"text":"API","anchor":"api","htmlText":"API"},{"level":2,"text":"High-Level API (MessagePackSerializer)","anchor":"high-level-api-messagepackserializer","htmlText":"High-Level API (MessagePackSerializer)"},{"level":3,"text":"Multiple MessagePack structures on a single Stream","anchor":"multiple-messagepack-structures-on-a-single-stream","htmlText":"Multiple MessagePack structures on a single Stream"},{"level":2,"text":"Low-Level API (IMessagePackFormatter\u003cT\u003e)","anchor":"low-level-api-imessagepackformattert","htmlText":"Low-Level API (IMessagePackFormatter\u0026lt;T\u0026gt;)"},{"level":2,"text":"Primitive API (MessagePackWriter, MessagePackReader)","anchor":"primitive-api-messagepackwriter-messagepackreader","htmlText":"Primitive API (MessagePackWriter, MessagePackReader)"},{"level":3,"text":"MessagePackReader","anchor":"messagepackreader","htmlText":"MessagePackReader"},{"level":3,"text":"MessagePackWriter","anchor":"messagepackwriter","htmlText":"MessagePackWriter"},{"level":2,"text":"Main Extension Point (IFormatterResolver)","anchor":"main-extension-point-iformatterresolver","htmlText":"Main Extension Point (IFormatterResolver)"},{"level":2,"text":"MessagePackFormatterAttribute","anchor":"messagepackformatterattribute","htmlText":"MessagePackFormatterAttribute"},{"level":2,"text":"IgnoreFormatter","anchor":"ignoreformatter","htmlText":"IgnoreFormatter"},{"level":2,"text":"Reserved Extension Types","anchor":"reserved-extension-types","htmlText":"Reserved Extension Types"},{"level":2,"text":"Unity support","anchor":"unity-support","htmlText":"Unity support"},{"level":2,"text":"AOT Code Generation (support for Unity/Xamarin)","anchor":"aot-code-generation-support-for-unityxamarin","htmlText":"AOT Code Generation (support for Unity/Xamarin)"},{"level":2,"text":"RPC","anchor":"rpc","htmlText":"RPC"},{"level":3,"text":"MagicOnion","anchor":"magiconion","htmlText":"MagicOnion"},{"level":3,"text":"StreamJsonRpc","anchor":"streamjsonrpc","htmlText":"StreamJsonRpc"},{"level":2,"text":"How to build","anchor":"how-to-build","htmlText":"How to build"},{"level":2,"text":"Code of Conduct","anchor":"code-of-conduct","htmlText":"Code of Conduct"},{"level":2,"text":".NET Foundation","anchor":"net-foundation","htmlText":".NET Foundation"}],"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FMessagePack-CSharp%2FMessagePack-CSharp"}},{"displayName":"LICENSE","repoName":"MessagePack-CSharp","refName":"master","path":"LICENSE","preferredFileType":"license","tabName":"License","richText":null,"loaded":false,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":null,"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FMessagePack-CSharp%2FMessagePack-CSharp"}},{"displayName":"SECURITY.md","repoName":"MessagePack-CSharp","refName":"master","path":"SECURITY.md","preferredFileType":"security","tabName":"Security","richText":null,"loaded":false,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":null,"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FMessagePack-CSharp%2FMessagePack-CSharp"}}],"overviewFilesProcessingTime":0}},"appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-1583894afd38.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-67668e8c2caa.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"overview_shared_code_dropdown_button":false,"react_blob_overlay":false,"copilot_conversational_ux_embedding_update":false,"copilot_smell_icebreaker_ux":true,"copilot_workspace":false,"accessible_code_button":true}}}}</script> <div data-target="react-partial.reactRoot"><style data-styled="true" data-styled-version="5.3.11">.iVEunk{margin-top:16px;margin-bottom:16px;}/*!sc*/ .jzuOtQ{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}/*!sc*/ .bGojzy{margin-bottom:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;row-gap:16px;}/*!sc*/ .iNSVHo{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;padding-bottom:16px;padding-top:8px;}/*!sc*/ .bVgnfw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;gap:8px;}/*!sc*/ @media screen and (max-width:320px){.bVgnfw{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}}/*!sc*/ .CEgMp{position:relative;}/*!sc*/ @media screen and (max-width:380px){.CEgMp .ref-selector-button-text-container{max-width:80px;}}/*!sc*/ @media screen and (max-width:320px){.CEgMp{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}.CEgMp .overview-ref-selector{width:100%;}.CEgMp .overview-ref-selector > span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;}.CEgMp .overview-ref-selector > span > span[data-component="text"]{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}}/*!sc*/ .gUkoLg{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}/*!sc*/ .bZBlpz{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;}/*!sc*/ .lhTYNA{margin-right:4px;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .ffLUq{font-size:14px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}/*!sc*/ .hzSPyu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;pointer-events:none;}/*!sc*/ .fLXEGX{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (max-width:1079px){.fLXEGX{display:none;}}/*!sc*/ .dqfxud{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (min-width:1080px){.dqfxud{display:none;}}/*!sc*/ @media screen and (max-width:543px){.dqfxud{display:none;}}/*!sc*/ .jxTzTd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-left:8px;gap:8px;}/*!sc*/ .gqqBXN{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:8px;}/*!sc*/ @media screen and (max-width:543px){.gqqBXN{display:none;}}/*!sc*/ .dzXgxt{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (max-width:1011px){.dzXgxt{display:none;}}/*!sc*/ .iWFGlI{margin-left:8px;margin-right:8px;margin:0;}/*!sc*/ .YUPas{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (min-width:1012px){.YUPas{display:none;}}/*!sc*/ .izFOf{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (min-width:544px){.izFOf{display:none;}}/*!sc*/ .vIPPs{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:16px;}/*!sc*/ .fdROMU{width:100%;border-collapse:separate;border-spacing:0;border:1px solid;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));border-radius:6px;table-layout:fixed;overflow:unset;}/*!sc*/ .jGKpsv{height:0px;line-height:0px;}/*!sc*/ .jGKpsv tr{height:0px;font-size:0px;}/*!sc*/ .jdgHnn{padding:16px;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));font-size:12px;text-align:left;height:40px;}/*!sc*/ .jdgHnn th{padding-left:16px;background-color:var(--bgColor-muted,var(--color-canvas-subtle,#f6f8fa));}/*!sc*/ .bQivRW{width:100%;border-top-left-radius:6px;}/*!sc*/ @media screen and (min-width:544px){.bQivRW{display:none;}}/*!sc*/ .ldkMIO{width:40%;border-top-left-radius:6px;}/*!sc*/ @media screen and (max-width:543px){.ldkMIO{display:none;}}/*!sc*/ .jMbWeI{text-align:right;padding-right:16px;width:136px;border-top-right-radius:6px;}/*!sc*/ .gpqjiB{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));font-size:12px;height:40px;}/*!sc*/ .dzCJzi{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:8px;min-width:273px;padding:8px;}/*!sc*/ @media screen and (min-width:544px){.dzCJzi{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;}}/*!sc*/ .eNCcrz{text-align:center;vertical-align:center;height:40px;border-top:1px solid;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));}/*!sc*/ .bHTcCe{border-top:1px solid var(--borderColor-default,var(--color-border-default));cursor:pointer;}/*!sc*/ .csrIcr{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;gap:16px;}/*!sc*/ .bUQNHB{border:1px solid;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));border-radius:6px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}/*!sc*/ @media screen and (max-width:543px){.bUQNHB{margin-left:-16px;margin-right:-16px;max-width:calc(100% + 32px);}}/*!sc*/ @media screen and (min-width:544px){.bUQNHB{max-width:100%;}}/*!sc*/ .jPdcfu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-bottom:1px solid;border-bottom-color:var(--borderColor-default,var(--color-border-default,#d0d7de));-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-right:8px;position:-webkit-sticky;position:sticky;top:0;background-color:var(--bgColor-default,var(--color-canvas-default,#ffffff));z-index:1;border-top-left-radius:6px;border-top-right-radius:6px;}/*!sc*/ .hUCRAk{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/ .QkQOb{padding:32px;overflow:auto;}/*!sc*/ data-styled.g1[id="Box-sc-g0xbh4-0"]{content:"iVEunk,jzuOtQ,bGojzy,iNSVHo,bVgnfw,CEgMp,gUkoLg,bZBlpz,lhTYNA,ffLUq,hzSPyu,fLXEGX,dqfxud,jxTzTd,gqqBXN,dzXgxt,iWFGlI,YUPas,izFOf,vIPPs,fdROMU,jGKpsv,jdgHnn,bQivRW,ldkMIO,jMbWeI,gpqjiB,dzCJzi,eNCcrz,bHTcCe,csrIcr,bUQNHB,jPdcfu,hUCRAk,QkQOb,"}/*!sc*/ .eMMFM{min-width:0;}/*!sc*/ .eMMFM:where([data-size='small']){font-size:var(--text-body-size-small,0.75rem);line-height:var(--text-body-lineHeight-small,1.6666);}/*!sc*/ .eMMFM:where([data-size='medium']){font-size:var(--text-body-size-medium,0.875rem);line-height:var(--text-body-lineHeight-medium,1.4285);}/*!sc*/ .eMMFM:where([data-size='large']){font-size:var(--text-body-size-large,1rem);line-height:var(--text-body-lineHeight-large,1.5);}/*!sc*/ .eMMFM:where([data-weight='light']){font-weight:var(--base-text-weight-light,300);}/*!sc*/ .eMMFM:where([data-weight='normal']){font-weight:var(--base-text-weight-normal,400);}/*!sc*/ .eMMFM:where([data-weight='medium']){font-weight:var(--base-text-weight-medium,500);}/*!sc*/ .eMMFM:where([data-weight='semibold']){font-weight:var(--base-text-weight-semibold,600);}/*!sc*/ data-styled.g3[id="Text__StyledText-sc-17v1xeu-0"]{content:"eMMFM,"}/*!sc*/ .brGdpi{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;-webkit-clip:rect(0,0,0,0);clip:rect(0,0,0,0);white-space:nowrap;border-width:0;}/*!sc*/ data-styled.g4[id="_VisuallyHidden__VisuallyHidden-sc-11jhm7a-0"]{content:"brGdpi,"}/*!sc*/ .gwqFqs{font-size:14px;line-height:20px;color:var(--fgColor-default,var(--color-fg-default,#1F2328));vertical-align:middle;background-color:var(--bgColor-default,var(--color-canvas-default,#ffffff));border:1px solid var(--control-borderColor-rest,var(--borderColor-default,var(--color-border-default,#d0d7de)));border-radius:6px;outline:none;box-shadow:var(--shadow-inset,var(--color-primer-shadow-inset,inset 0 1px 0 rgba(208,215,222,0.2)));display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;min-height:32px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-width:160px;}/*!sc*/ .gwqFqs input,.gwqFqs textarea{cursor:text;}/*!sc*/ .gwqFqs select{cursor:pointer;}/*!sc*/ .gwqFqs input::-webkit-input-placeholder,.gwqFqs textarea::-webkit-input-placeholder,.gwqFqs select::-webkit-input-placeholder{color:var(---control-fgColor-placeholder,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gwqFqs input::-moz-placeholder,.gwqFqs textarea::-moz-placeholder,.gwqFqs select::-moz-placeholder{color:var(---control-fgColor-placeholder,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gwqFqs input:-ms-input-placeholder,.gwqFqs textarea:-ms-input-placeholder,.gwqFqs select:-ms-input-placeholder{color:var(---control-fgColor-placeholder,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gwqFqs input::placeholder,.gwqFqs textarea::placeholder,.gwqFqs select::placeholder{color:var(---control-fgColor-placeholder,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gwqFqs:focus-within{border-color:var(--fgColor-accent,var(--color-accent-fg,#0969da));outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-1px;}/*!sc*/ .gwqFqs > textarea{padding:12px;}/*!sc*/ @media (min-width:768px){.gwqFqs{font-size:14px;}}/*!sc*/ data-styled.g9[id="TextInputWrapper__TextInputBaseWrapper-sc-1mqhpbi-0"]{content:"gwqFqs,"}/*!sc*/ .decvaq{background-repeat:no-repeat;background-position:right 8px center;padding-left:12px;padding-right:12px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-width:160px;}/*!sc*/ .decvaq > :not(:last-child){margin-right:8px;}/*!sc*/ .decvaq .TextInput-icon,.decvaq .TextInput-action{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}/*!sc*/ .decvaq > input,.decvaq > select{padding-left:0;padding-right:0;}/*!sc*/ data-styled.g10[id="TextInputWrapper-sc-1mqhpbi-1"]{content:"decvaq,"}/*!sc*/ .gVXRRg{border-radius:6px;border:1px solid;border-color:var(--button-default-borderColor-rest,var(--button-default-borderColor-rest,var(--color-btn-border,rgba(31,35,40,0.15))));font-family:inherit;font-weight:500;font-size:14px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-text-decoration:none;text-decoration:none;text-align:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;height:32px;padding:0 12px;gap:8px;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;-webkit-transition:80ms cubic-bezier(0.65,0,0.35,1);transition:80ms cubic-bezier(0.65,0,0.35,1);-webkit-transition-property:color,fill,background-color,border-color;transition-property:color,fill,background-color,border-color;color:var(--button-default-fgColor-rest,var(--color-btn-text,#24292f));background-color:var(--button-default-bgColor-rest,var(--color-btn-bg,#f6f8fa));box-shadow:var(--button-default-shadow-resting,var(--color-btn-shadow,0 1px 0 rgba(31,35,40,0.04))),var(--button-default-shadow-inset,var(--color-btn-inset-shadow,inset 0 1px 0 rgba(255,255,255,0.25)));}/*!sc*/ .gVXRRg:focus:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .gVXRRg:focus:not(:disabled):not(:focus-visible){outline:solid 1px transparent;}/*!sc*/ .gVXRRg:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .gVXRRg[href]{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}/*!sc*/ .gVXRRg[href]:hover{-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .gVXRRg:hover{-webkit-transition-duration:80ms;transition-duration:80ms;}/*!sc*/ .gVXRRg:active{-webkit-transition:none;transition:none;}/*!sc*/ .gVXRRg[data-inactive]{cursor:auto;}/*!sc*/ .gVXRRg:disabled{cursor:not-allowed;box-shadow:none;color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));border-color:var(--button-default-borderColor-disabled,var(--button-default-borderColor-rest,var(--color-btn-border,rgba(31,35,40,0.15))));background-color:var(--button-default-bgColor-disabled,var(--control-bgColor-disabled,var(--color-input-disabled-bg,rgba(175,184,193,0.2))));}/*!sc*/ .gVXRRg:disabled [data-component=ButtonCounter]{color:inherit;}/*!sc*/ @media (forced-colors:active){.gVXRRg:focus{outline:solid 1px transparent;}}/*!sc*/ .gVXRRg [data-component=ButtonCounter]{font-size:12px;background-color:var(--buttonCounter-default-bgColor-rest,var(--color-btn-counter-bg,rgba(31,35,40,0.08)));}/*!sc*/ .gVXRRg[data-component=IconButton]{display:inline-grid;padding:unset;place-content:center;width:32px;min-width:unset;}/*!sc*/ .gVXRRg[data-size="small"]{padding:0 8px;height:28px;gap:4px;font-size:12px;}/*!sc*/ .gVXRRg[data-size="small"] [data-component="text"]{line-height:1.6666667;}/*!sc*/ .gVXRRg[data-size="small"] [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .gVXRRg[data-size="small"] [data-component="buttonContent"] > :not(:last-child){margin-right:4px;}/*!sc*/ .gVXRRg[data-size="small"][data-component=IconButton]{width:28px;padding:unset;}/*!sc*/ .gVXRRg[data-size="large"]{padding:0 16px;height:40px;gap:8px;}/*!sc*/ .gVXRRg[data-size="large"] [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .gVXRRg[data-size="large"][data-component=IconButton]{width:40px;padding:unset;}/*!sc*/ .gVXRRg[data-block="block"]{width:100%;}/*!sc*/ .gVXRRg[data-label-wrap="true"]{min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;height:unset;min-height:var(--control-medium-size,2rem);}/*!sc*/ .gVXRRg[data-label-wrap="true"] [data-component="buttonContent"]{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;padding-block:calc(var(--control-medium-paddingBlock,0.375rem) - 2px);}/*!sc*/ .gVXRRg[data-label-wrap="true"] [data-component="text"]{white-space:unset;word-break:break-word;}/*!sc*/ .gVXRRg[data-label-wrap="true"][data-size="small"]{height:unset;min-height:var(--control-small-size,1.75rem);}/*!sc*/ .gVXRRg[data-label-wrap="true"][data-size="small"] [data-component="buttonContent"]{padding-block:calc(var(--control-small-paddingBlock,0.25rem) - 2px);}/*!sc*/ .gVXRRg[data-label-wrap="true"][data-size="large"]{height:unset;min-height:var(--control-large-size,2.5rem);padding-inline:var(--control-large-paddingInline-spacious,1rem);}/*!sc*/ .gVXRRg[data-label-wrap="true"][data-size="large"] [data-component="buttonContent"]{padding-block:calc(var(--control-large-paddingBlock,0.625rem) - 2px);}/*!sc*/ .gVXRRg[data-inactive]:not([disabled]){background-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));border-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));color:var(--button-inactive-fgColor,var(--button-inactive-fgColor-rest,var(--color-btn-inactive-text,#57606a)));}/*!sc*/ .gVXRRg[data-inactive]:not([disabled]):focus-visible{box-shadow:none;}/*!sc*/ .gVXRRg [data-component="leadingVisual"]{grid-area:leadingVisual;}/*!sc*/ .gVXRRg [data-component="text"]{grid-area:text;line-height:1.4285714;white-space:nowrap;}/*!sc*/ .gVXRRg [data-component="trailingVisual"]{grid-area:trailingVisual;}/*!sc*/ .gVXRRg [data-component="trailingAction"]{margin-right:-4px;}/*!sc*/ .gVXRRg [data-component="buttonContent"]{-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;display:grid;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0,auto) min-content;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;}/*!sc*/ .gVXRRg [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .gVXRRg [data-component="loadingSpinner"]{grid-area:text;margin-right:0px !important;place-self:center;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .gVXRRg [data-component="loadingSpinner"] + [data-component="text"]{visibility:hidden;}/*!sc*/ .gVXRRg:hover:not([disabled]):not([data-inactive]){background-color:var(--button-default-bgColor-hover,var(--color-btn-hover-bg,#f3f4f6));border-color:var(--button-default-borderColor-hover,var(--button-default-borderColor-hover,var(--color-btn-hover-border,rgba(31,35,40,0.15))));}/*!sc*/ .gVXRRg:active:not([disabled]):not([data-inactive]){background-color:var(--button-default-bgColor-active,var(--color-btn-active-bg,hsla(220,14%,93%,1)));border-color:var(--button-default-borderColor-active,var(--button-default-borderColor-active,var(--color-btn-active-border,rgba(31,35,40,0.15))));}/*!sc*/ .gVXRRg[aria-expanded=true]{background-color:var(--button-default-bgColor-active,var(--color-btn-active-bg,hsla(220,14%,93%,1)));border-color:var(--button-default-borderColor-active,var(--button-default-borderColor-active,var(--color-btn-active-border,rgba(31,35,40,0.15))));}/*!sc*/ .gVXRRg [data-component="leadingVisual"],.gVXRRg [data-component="trailingVisual"],.gVXRRg [data-component="trailingAction"]{color:var(--button-color,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gVXRRg[data-component="IconButton"][data-no-visuals]:not(:disabled){color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .gVXRRg[data-size="medium"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-width:0;}/*!sc*/ .gVXRRg[data-size="medium"] svg{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .gVXRRg[data-size="medium"] > span{width:inherit;}/*!sc*/ .loAzyw{border-radius:6px;border:1px solid;border-color:transparent;font-family:inherit;font-weight:500;font-size:14px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-text-decoration:none;text-decoration:none;text-align:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;height:32px;padding:0 12px;gap:8px;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;-webkit-transition:80ms cubic-bezier(0.65,0,0.35,1);transition:80ms cubic-bezier(0.65,0,0.35,1);-webkit-transition-property:color,fill,background-color,border-color;transition-property:color,fill,background-color,border-color;color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));background-color:transparent;box-shadow:none;}/*!sc*/ .loAzyw:focus:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .loAzyw:focus:not(:disabled):not(:focus-visible){outline:solid 1px transparent;}/*!sc*/ .loAzyw:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .loAzyw[href]{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}/*!sc*/ .loAzyw[href]:hover{-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .loAzyw:hover{-webkit-transition-duration:80ms;transition-duration:80ms;}/*!sc*/ .loAzyw:active{-webkit-transition:none;transition:none;}/*!sc*/ .loAzyw[data-inactive]{cursor:auto;}/*!sc*/ .loAzyw:disabled{cursor:not-allowed;box-shadow:none;color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));background-color:var(--button-invisible-bgColor-disabled,transparent);}/*!sc*/ .loAzyw:disabled [data-component=ButtonCounter],.loAzyw:disabled [data-component="leadingVisual"],.loAzyw:disabled [data-component="trailingAction"]{color:inherit;}/*!sc*/ @media (forced-colors:active){.loAzyw:focus{outline:solid 1px transparent;}}/*!sc*/ .loAzyw [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .loAzyw[data-component=IconButton]{display:inline-grid;padding:unset;place-content:center;width:32px;min-width:unset;}/*!sc*/ .loAzyw[data-size="small"]{padding:0 8px;height:28px;gap:4px;font-size:12px;}/*!sc*/ .loAzyw[data-size="small"] [data-component="text"]{line-height:1.6666667;}/*!sc*/ .loAzyw[data-size="small"] [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .loAzyw[data-size="small"] [data-component="buttonContent"] > :not(:last-child){margin-right:4px;}/*!sc*/ .loAzyw[data-size="small"][data-component=IconButton]{width:28px;padding:unset;}/*!sc*/ .loAzyw[data-size="large"]{padding:0 16px;height:40px;gap:8px;}/*!sc*/ .loAzyw[data-size="large"] [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .loAzyw[data-size="large"][data-component=IconButton]{width:40px;padding:unset;}/*!sc*/ .loAzyw[data-block="block"]{width:100%;}/*!sc*/ .loAzyw[data-label-wrap="true"]{min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;height:unset;min-height:var(--control-medium-size,2rem);}/*!sc*/ .loAzyw[data-label-wrap="true"] [data-component="buttonContent"]{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;padding-block:calc(var(--control-medium-paddingBlock,0.375rem) - 2px);}/*!sc*/ .loAzyw[data-label-wrap="true"] [data-component="text"]{white-space:unset;word-break:break-word;}/*!sc*/ .loAzyw[data-label-wrap="true"][data-size="small"]{height:unset;min-height:var(--control-small-size,1.75rem);}/*!sc*/ .loAzyw[data-label-wrap="true"][data-size="small"] [data-component="buttonContent"]{padding-block:calc(var(--control-small-paddingBlock,0.25rem) - 2px);}/*!sc*/ .loAzyw[data-label-wrap="true"][data-size="large"]{height:unset;min-height:var(--control-large-size,2.5rem);padding-inline:var(--control-large-paddingInline-spacious,1rem);}/*!sc*/ .loAzyw[data-label-wrap="true"][data-size="large"] [data-component="buttonContent"]{padding-block:calc(var(--control-large-paddingBlock,0.625rem) - 2px);}/*!sc*/ .loAzyw[data-inactive]:not([disabled]){background-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));border-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));color:var(--button-inactive-fgColor,var(--button-inactive-fgColor-rest,var(--color-btn-inactive-text,#57606a)));}/*!sc*/ .loAzyw[data-inactive]:not([disabled]):focus-visible{box-shadow:none;}/*!sc*/ .loAzyw [data-component="leadingVisual"]{grid-area:leadingVisual;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .loAzyw [data-component="text"]{grid-area:text;line-height:1.4285714;white-space:nowrap;}/*!sc*/ .loAzyw [data-component="trailingVisual"]{grid-area:trailingVisual;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .loAzyw [data-component="trailingAction"]{margin-right:-4px;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .loAzyw [data-component="buttonContent"]{-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;display:grid;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0,auto) min-content;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;}/*!sc*/ .loAzyw [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .loAzyw [data-component="loadingSpinner"]{grid-area:text;margin-right:0px !important;place-self:center;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .loAzyw [data-component="loadingSpinner"] + [data-component="text"]{visibility:hidden;}/*!sc*/ .loAzyw:hover:not([disabled]){background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg,rgba(208,215,222,0.32)));}/*!sc*/ .loAzyw:active:not([disabled]){background-color:var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg,rgba(208,215,222,0.48)));}/*!sc*/ .loAzyw[aria-expanded=true]{background-color:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg,rgba(208,215,222,0.24)));}/*!sc*/ .loAzyw[data-component="IconButton"][data-no-visuals]{color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .loAzyw[data-no-visuals]{color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));}/*!sc*/ .loAzyw:has([data-component="ButtonCounter"]){color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));}/*!sc*/ .loAzyw:disabled[data-no-visuals]{color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));}/*!sc*/ .loAzyw:disabled[data-no-visuals] [data-component=ButtonCounter]{color:inherit;}/*!sc*/ .loAzyw[data-size="medium"]{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));padding-left:4px;padding-right:4px;}/*!sc*/ .loAzyw[data-size="medium"] span[data-component="leadingVisual"]{margin-right:4px !important;}/*!sc*/ .cXsOlJ{border-radius:6px;border:1px solid;border-color:transparent;font-family:inherit;font-weight:500;font-size:14px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-text-decoration:none;text-decoration:none;text-align:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;height:32px;padding:0 12px;gap:8px;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;-webkit-transition:80ms cubic-bezier(0.65,0,0.35,1);transition:80ms cubic-bezier(0.65,0,0.35,1);-webkit-transition-property:color,fill,background-color,border-color;transition-property:color,fill,background-color,border-color;color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));background-color:transparent;box-shadow:none;}/*!sc*/ .cXsOlJ:focus:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .cXsOlJ:focus:not(:disabled):not(:focus-visible){outline:solid 1px transparent;}/*!sc*/ .cXsOlJ:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .cXsOlJ[href]{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}/*!sc*/ .cXsOlJ[href]:hover{-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .cXsOlJ:hover{-webkit-transition-duration:80ms;transition-duration:80ms;}/*!sc*/ .cXsOlJ:active{-webkit-transition:none;transition:none;}/*!sc*/ .cXsOlJ[data-inactive]{cursor:auto;}/*!sc*/ .cXsOlJ:disabled{cursor:not-allowed;box-shadow:none;color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));background-color:var(--button-invisible-bgColor-disabled,transparent);}/*!sc*/ .cXsOlJ:disabled [data-component=ButtonCounter],.cXsOlJ:disabled [data-component="leadingVisual"],.cXsOlJ:disabled [data-component="trailingAction"]{color:inherit;}/*!sc*/ @media (forced-colors:active){.cXsOlJ:focus{outline:solid 1px transparent;}}/*!sc*/ .cXsOlJ [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .cXsOlJ[data-component=IconButton]{display:inline-grid;padding:unset;place-content:center;width:32px;min-width:unset;}/*!sc*/ .cXsOlJ[data-size="small"]{padding:0 8px;height:28px;gap:4px;font-size:12px;}/*!sc*/ .cXsOlJ[data-size="small"] [data-component="text"]{line-height:1.6666667;}/*!sc*/ .cXsOlJ[data-size="small"] [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .cXsOlJ[data-size="small"] [data-component="buttonContent"] > :not(:last-child){margin-right:4px;}/*!sc*/ .cXsOlJ[data-size="small"][data-component=IconButton]{width:28px;padding:unset;}/*!sc*/ .cXsOlJ[data-size="large"]{padding:0 16px;height:40px;gap:8px;}/*!sc*/ .cXsOlJ[data-size="large"] [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .cXsOlJ[data-size="large"][data-component=IconButton]{width:40px;padding:unset;}/*!sc*/ .cXsOlJ[data-block="block"]{width:100%;}/*!sc*/ .cXsOlJ[data-label-wrap="true"]{min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;height:unset;min-height:var(--control-medium-size,2rem);}/*!sc*/ .cXsOlJ[data-label-wrap="true"] [data-component="buttonContent"]{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;padding-block:calc(var(--control-medium-paddingBlock,0.375rem) - 2px);}/*!sc*/ .cXsOlJ[data-label-wrap="true"] [data-component="text"]{white-space:unset;word-break:break-word;}/*!sc*/ .cXsOlJ[data-label-wrap="true"][data-size="small"]{height:unset;min-height:var(--control-small-size,1.75rem);}/*!sc*/ .cXsOlJ[data-label-wrap="true"][data-size="small"] [data-component="buttonContent"]{padding-block:calc(var(--control-small-paddingBlock,0.25rem) - 2px);}/*!sc*/ .cXsOlJ[data-label-wrap="true"][data-size="large"]{height:unset;min-height:var(--control-large-size,2.5rem);padding-inline:var(--control-large-paddingInline-spacious,1rem);}/*!sc*/ .cXsOlJ[data-label-wrap="true"][data-size="large"] [data-component="buttonContent"]{padding-block:calc(var(--control-large-paddingBlock,0.625rem) - 2px);}/*!sc*/ .cXsOlJ[data-inactive]:not([disabled]){background-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));border-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));color:var(--button-inactive-fgColor,var(--button-inactive-fgColor-rest,var(--color-btn-inactive-text,#57606a)));}/*!sc*/ .cXsOlJ[data-inactive]:not([disabled]):focus-visible{box-shadow:none;}/*!sc*/ .cXsOlJ [data-component="leadingVisual"]{grid-area:leadingVisual;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .cXsOlJ [data-component="text"]{grid-area:text;line-height:1.4285714;white-space:nowrap;}/*!sc*/ .cXsOlJ [data-component="trailingVisual"]{grid-area:trailingVisual;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .cXsOlJ [data-component="trailingAction"]{margin-right:-4px;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .cXsOlJ [data-component="buttonContent"]{-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;display:grid;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0,auto) min-content;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;}/*!sc*/ .cXsOlJ [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .cXsOlJ [data-component="loadingSpinner"]{grid-area:text;margin-right:0px !important;place-self:center;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .cXsOlJ [data-component="loadingSpinner"] + [data-component="text"]{visibility:hidden;}/*!sc*/ .cXsOlJ:hover:not([disabled]){background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg,rgba(208,215,222,0.32)));}/*!sc*/ .cXsOlJ:active:not([disabled]){background-color:var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg,rgba(208,215,222,0.48)));}/*!sc*/ .cXsOlJ[aria-expanded=true]{background-color:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg,rgba(208,215,222,0.24)));}/*!sc*/ .cXsOlJ[data-component="IconButton"][data-no-visuals]{color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .cXsOlJ[data-no-visuals]{color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));}/*!sc*/ .cXsOlJ:has([data-component="ButtonCounter"]){color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));}/*!sc*/ .cXsOlJ:disabled[data-no-visuals]{color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));}/*!sc*/ .cXsOlJ:disabled[data-no-visuals] [data-component=ButtonCounter]{color:inherit;}/*!sc*/ .cXsOlJ[data-size="medium"][data-no-visuals]{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .gGdPyq{border-radius:6px;border:1px solid;border-color:var(--button-default-borderColor-rest,var(--button-default-borderColor-rest,var(--color-btn-border,rgba(31,35,40,0.15))));font-family:inherit;font-weight:500;font-size:14px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-text-decoration:none;text-decoration:none;text-align:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;height:32px;padding:0 12px;gap:8px;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;-webkit-transition:80ms cubic-bezier(0.65,0,0.35,1);transition:80ms cubic-bezier(0.65,0,0.35,1);-webkit-transition-property:color,fill,background-color,border-color;transition-property:color,fill,background-color,border-color;color:var(--button-default-fgColor-rest,var(--color-btn-text,#24292f));background-color:var(--button-default-bgColor-rest,var(--color-btn-bg,#f6f8fa));box-shadow:var(--button-default-shadow-resting,var(--color-btn-shadow,0 1px 0 rgba(31,35,40,0.04))),var(--button-default-shadow-inset,var(--color-btn-inset-shadow,inset 0 1px 0 rgba(255,255,255,0.25)));}/*!sc*/ .gGdPyq:focus:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .gGdPyq:focus:not(:disabled):not(:focus-visible){outline:solid 1px transparent;}/*!sc*/ .gGdPyq:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .gGdPyq[href]{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}/*!sc*/ .gGdPyq[href]:hover{-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .gGdPyq:hover{-webkit-transition-duration:80ms;transition-duration:80ms;}/*!sc*/ .gGdPyq:active{-webkit-transition:none;transition:none;}/*!sc*/ .gGdPyq[data-inactive]{cursor:auto;}/*!sc*/ .gGdPyq:disabled{cursor:not-allowed;box-shadow:none;color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));border-color:var(--button-default-borderColor-disabled,var(--button-default-borderColor-rest,var(--color-btn-border,rgba(31,35,40,0.15))));background-color:var(--button-default-bgColor-disabled,var(--control-bgColor-disabled,var(--color-input-disabled-bg,rgba(175,184,193,0.2))));}/*!sc*/ .gGdPyq:disabled [data-component=ButtonCounter]{color:inherit;}/*!sc*/ @media (forced-colors:active){.gGdPyq:focus{outline:solid 1px transparent;}}/*!sc*/ .gGdPyq [data-component=ButtonCounter]{font-size:12px;background-color:var(--buttonCounter-default-bgColor-rest,var(--color-btn-counter-bg,rgba(31,35,40,0.08)));}/*!sc*/ .gGdPyq[data-component=IconButton]{display:inline-grid;padding:unset;place-content:center;width:32px;min-width:unset;}/*!sc*/ .gGdPyq[data-size="small"]{padding:0 8px;height:28px;gap:4px;font-size:12px;}/*!sc*/ .gGdPyq[data-size="small"] [data-component="text"]{line-height:1.6666667;}/*!sc*/ .gGdPyq[data-size="small"] [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .gGdPyq[data-size="small"] [data-component="buttonContent"] > :not(:last-child){margin-right:4px;}/*!sc*/ .gGdPyq[data-size="small"][data-component=IconButton]{width:28px;padding:unset;}/*!sc*/ .gGdPyq[data-size="large"]{padding:0 16px;height:40px;gap:8px;}/*!sc*/ .gGdPyq[data-size="large"] [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .gGdPyq[data-size="large"][data-component=IconButton]{width:40px;padding:unset;}/*!sc*/ .gGdPyq[data-block="block"]{width:100%;}/*!sc*/ .gGdPyq[data-label-wrap="true"]{min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;height:unset;min-height:var(--control-medium-size,2rem);}/*!sc*/ .gGdPyq[data-label-wrap="true"] [data-component="buttonContent"]{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;padding-block:calc(var(--control-medium-paddingBlock,0.375rem) - 2px);}/*!sc*/ .gGdPyq[data-label-wrap="true"] [data-component="text"]{white-space:unset;word-break:break-word;}/*!sc*/ .gGdPyq[data-label-wrap="true"][data-size="small"]{height:unset;min-height:var(--control-small-size,1.75rem);}/*!sc*/ .gGdPyq[data-label-wrap="true"][data-size="small"] [data-component="buttonContent"]{padding-block:calc(var(--control-small-paddingBlock,0.25rem) - 2px);}/*!sc*/ .gGdPyq[data-label-wrap="true"][data-size="large"]{height:unset;min-height:var(--control-large-size,2.5rem);padding-inline:var(--control-large-paddingInline-spacious,1rem);}/*!sc*/ .gGdPyq[data-label-wrap="true"][data-size="large"] [data-component="buttonContent"]{padding-block:calc(var(--control-large-paddingBlock,0.625rem) - 2px);}/*!sc*/ .gGdPyq[data-inactive]:not([disabled]){background-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));border-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));color:var(--button-inactive-fgColor,var(--button-inactive-fgColor-rest,var(--color-btn-inactive-text,#57606a)));}/*!sc*/ .gGdPyq[data-inactive]:not([disabled]):focus-visible{box-shadow:none;}/*!sc*/ .gGdPyq [data-component="leadingVisual"]{grid-area:leadingVisual;}/*!sc*/ .gGdPyq [data-component="text"]{grid-area:text;line-height:1.4285714;white-space:nowrap;}/*!sc*/ .gGdPyq [data-component="trailingVisual"]{grid-area:trailingVisual;}/*!sc*/ .gGdPyq [data-component="trailingAction"]{margin-right:-4px;}/*!sc*/ .gGdPyq [data-component="buttonContent"]{-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;display:grid;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0,auto) min-content;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;}/*!sc*/ .gGdPyq [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .gGdPyq [data-component="loadingSpinner"]{grid-area:text;margin-right:0px !important;place-self:center;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .gGdPyq [data-component="loadingSpinner"] + [data-component="text"]{visibility:hidden;}/*!sc*/ .gGdPyq:hover:not([disabled]):not([data-inactive]){background-color:var(--button-default-bgColor-hover,var(--color-btn-hover-bg,#f3f4f6));border-color:var(--button-default-borderColor-hover,var(--button-default-borderColor-hover,var(--color-btn-hover-border,rgba(31,35,40,0.15))));}/*!sc*/ .gGdPyq:active:not([disabled]):not([data-inactive]){background-color:var(--button-default-bgColor-active,var(--color-btn-active-bg,hsla(220,14%,93%,1)));border-color:var(--button-default-borderColor-active,var(--button-default-borderColor-active,var(--color-btn-active-border,rgba(31,35,40,0.15))));}/*!sc*/ .gGdPyq[aria-expanded=true]{background-color:var(--button-default-bgColor-active,var(--color-btn-active-bg,hsla(220,14%,93%,1)));border-color:var(--button-default-borderColor-active,var(--button-default-borderColor-active,var(--color-btn-active-border,rgba(31,35,40,0.15))));}/*!sc*/ .gGdPyq [data-component="leadingVisual"],.gGdPyq [data-component="trailingVisual"],.gGdPyq [data-component="trailingAction"]{color:var(--button-color,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gGdPyq[data-component="IconButton"][data-no-visuals]:not(:disabled){color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .bmlmSe{border-radius:6px;border:1px solid;border-color:var(--button-primary-borderColor-rest,var(--color-btn-primary-border,rgba(31,35,40,0.15)));font-family:inherit;font-weight:500;font-size:14px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-text-decoration:none;text-decoration:none;text-align:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;height:32px;padding:0 12px;gap:8px;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;-webkit-transition:80ms cubic-bezier(0.65,0,0.35,1);transition:80ms cubic-bezier(0.65,0,0.35,1);-webkit-transition-property:color,fill,background-color,border-color;transition-property:color,fill,background-color,border-color;color:var(--button-primary-fgColor-rest,var(--color-btn-primary-text,#ffffff));background-color:var(--button-primary-bgColor-rest,var(--color-btn-primary-bg,#1f883d));box-shadow:var(--shadow-resting-small,var(--color-btn-primary-shadow,0 1px 0 rgba(31,35,40,0.1)));}/*!sc*/ .bmlmSe:focus:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .bmlmSe:focus:not(:disabled):not(:focus-visible){outline:solid 1px transparent;}/*!sc*/ .bmlmSe:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .bmlmSe[href]{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}/*!sc*/ .bmlmSe[href]:hover{-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .bmlmSe:hover{-webkit-transition-duration:80ms;transition-duration:80ms;}/*!sc*/ .bmlmSe:active{-webkit-transition:none;transition:none;}/*!sc*/ .bmlmSe[data-inactive]{cursor:auto;}/*!sc*/ .bmlmSe:disabled{cursor:not-allowed;box-shadow:none;color:var(--button-primary-fgColor-disabled,var(--color-btn-primary-disabled-text,rgba(255,255,255,0.8)));background-color:var(--button-primary-bgColor-disabled,var(--color-btn-primary-disabled-bg,#94d3a2));border-color:var(--button-primary-borderColor-disabled,var(--color-btn-primary-disabled-border,rgba(31,35,40,0.15)));}/*!sc*/ .bmlmSe:disabled [data-component=ButtonCounter]{color:inherit;}/*!sc*/ @media (forced-colors:active){.bmlmSe:focus{outline:solid 1px transparent;}}/*!sc*/ .bmlmSe [data-component=ButtonCounter]{font-size:12px;background-color:var(--buttonCounter-primary-bgColor-rest,var(--color-btn-primary-counter-bg,rgba(0,45,17,0.2)));color:var(--button-primary-fgColor-rest,var(--color-btn-primary-text,#ffffff));}/*!sc*/ .bmlmSe[data-component=IconButton]{display:inline-grid;padding:unset;place-content:center;width:32px;min-width:unset;}/*!sc*/ .bmlmSe[data-size="small"]{padding:0 8px;height:28px;gap:4px;font-size:12px;}/*!sc*/ .bmlmSe[data-size="small"] [data-component="text"]{line-height:1.6666667;}/*!sc*/ .bmlmSe[data-size="small"] [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .bmlmSe[data-size="small"] [data-component="buttonContent"] > :not(:last-child){margin-right:4px;}/*!sc*/ .bmlmSe[data-size="small"][data-component=IconButton]{width:28px;padding:unset;}/*!sc*/ .bmlmSe[data-size="large"]{padding:0 16px;height:40px;gap:8px;}/*!sc*/ .bmlmSe[data-size="large"] [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .bmlmSe[data-size="large"][data-component=IconButton]{width:40px;padding:unset;}/*!sc*/ .bmlmSe[data-block="block"]{width:100%;}/*!sc*/ .bmlmSe[data-label-wrap="true"]{min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;height:unset;min-height:var(--control-medium-size,2rem);}/*!sc*/ .bmlmSe[data-label-wrap="true"] [data-component="buttonContent"]{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;padding-block:calc(var(--control-medium-paddingBlock,0.375rem) - 2px);}/*!sc*/ .bmlmSe[data-label-wrap="true"] [data-component="text"]{white-space:unset;word-break:break-word;}/*!sc*/ .bmlmSe[data-label-wrap="true"][data-size="small"]{height:unset;min-height:var(--control-small-size,1.75rem);}/*!sc*/ .bmlmSe[data-label-wrap="true"][data-size="small"] [data-component="buttonContent"]{padding-block:calc(var(--control-small-paddingBlock,0.25rem) - 2px);}/*!sc*/ .bmlmSe[data-label-wrap="true"][data-size="large"]{height:unset;min-height:var(--control-large-size,2.5rem);padding-inline:var(--control-large-paddingInline-spacious,1rem);}/*!sc*/ .bmlmSe[data-label-wrap="true"][data-size="large"] [data-component="buttonContent"]{padding-block:calc(var(--control-large-paddingBlock,0.625rem) - 2px);}/*!sc*/ .bmlmSe[data-inactive]:not([disabled]){background-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));border-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));color:var(--button-inactive-fgColor,var(--button-inactive-fgColor-rest,var(--color-btn-inactive-text,#57606a)));}/*!sc*/ .bmlmSe[data-inactive]:not([disabled]):focus-visible{box-shadow:none;}/*!sc*/ .bmlmSe [data-component="leadingVisual"]{grid-area:leadingVisual;}/*!sc*/ .bmlmSe [data-component="text"]{grid-area:text;line-height:1.4285714;white-space:nowrap;}/*!sc*/ .bmlmSe [data-component="trailingVisual"]{grid-area:trailingVisual;}/*!sc*/ .bmlmSe [data-component="trailingAction"]{margin-right:-4px;}/*!sc*/ .bmlmSe [data-component="buttonContent"]{-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;display:grid;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0,auto) min-content;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;}/*!sc*/ .bmlmSe [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .bmlmSe [data-component="loadingSpinner"]{grid-area:text;margin-right:0px !important;place-self:center;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .bmlmSe [data-component="loadingSpinner"] + [data-component="text"]{visibility:hidden;}/*!sc*/ .bmlmSe:hover:not([disabled]):not([data-inactive]){color:btn.primary.hoverText;background-color:var(--button-primary-bgColor-hover,var(--color-btn-primary-hover-bg,#1a7f37));}/*!sc*/ .bmlmSe:focus:not([disabled]){box-shadow:inset 0 0 0 3px;}/*!sc*/ .bmlmSe:focus-visible:not([disabled]){box-shadow:inset 0 0 0 3px;}/*!sc*/ .bmlmSe:active:not([disabled]):not([data-inactive]){background-color:var(--button-primary-bgColor-active,var(--color-btn-primary-selected-bg,hsla(137,66%,28%,1)));box-shadow:var(--button-primary-shadow-selected,var(--color-btn-primary-selected-shadow,inset 0 1px 0 rgba(0,45,17,0.2)));}/*!sc*/ .bmlmSe[aria-expanded=true]{background-color:var(--button-primary-bgColor-active,var(--color-btn-primary-selected-bg,hsla(137,66%,28%,1)));box-shadow:var(--button-primary-shadow-selected,var(--color-btn-primary-selected-shadow,inset 0 1px 0 rgba(0,45,17,0.2)));}/*!sc*/ .dPmZyJ{border-radius:6px;border:1px solid;border-color:transparent;font-family:inherit;font-weight:500;font-size:14px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-text-decoration:none;text-decoration:none;text-align:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;height:32px;padding:0 12px;gap:8px;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;-webkit-transition:80ms cubic-bezier(0.65,0,0.35,1);transition:80ms cubic-bezier(0.65,0,0.35,1);-webkit-transition-property:color,fill,background-color,border-color;transition-property:color,fill,background-color,border-color;color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));background-color:transparent;box-shadow:none;}/*!sc*/ .dPmZyJ:focus:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .dPmZyJ:focus:not(:disabled):not(:focus-visible){outline:solid 1px transparent;}/*!sc*/ .dPmZyJ:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .dPmZyJ[href]{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}/*!sc*/ .dPmZyJ[href]:hover{-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .dPmZyJ:hover{-webkit-transition-duration:80ms;transition-duration:80ms;}/*!sc*/ .dPmZyJ:active{-webkit-transition:none;transition:none;}/*!sc*/ .dPmZyJ[data-inactive]{cursor:auto;}/*!sc*/ .dPmZyJ:disabled{cursor:not-allowed;box-shadow:none;color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));background-color:var(--button-invisible-bgColor-disabled,transparent);}/*!sc*/ .dPmZyJ:disabled [data-component=ButtonCounter],.dPmZyJ:disabled [data-component="leadingVisual"],.dPmZyJ:disabled [data-component="trailingAction"]{color:inherit;}/*!sc*/ @media (forced-colors:active){.dPmZyJ:focus{outline:solid 1px transparent;}}/*!sc*/ .dPmZyJ [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .dPmZyJ[data-component=IconButton]{display:inline-grid;padding:unset;place-content:center;width:32px;min-width:unset;}/*!sc*/ .dPmZyJ[data-size="small"]{padding:0 8px;height:28px;gap:4px;font-size:12px;}/*!sc*/ .dPmZyJ[data-size="small"] [data-component="text"]{line-height:1.6666667;}/*!sc*/ .dPmZyJ[data-size="small"] [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .dPmZyJ[data-size="small"] [data-component="buttonContent"] > :not(:last-child){margin-right:4px;}/*!sc*/ .dPmZyJ[data-size="small"][data-component=IconButton]{width:28px;padding:unset;}/*!sc*/ .dPmZyJ[data-size="large"]{padding:0 16px;height:40px;gap:8px;}/*!sc*/ .dPmZyJ[data-size="large"] [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .dPmZyJ[data-size="large"][data-component=IconButton]{width:40px;padding:unset;}/*!sc*/ .dPmZyJ[data-block="block"]{width:100%;}/*!sc*/ .dPmZyJ[data-label-wrap="true"]{min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;height:unset;min-height:var(--control-medium-size,2rem);}/*!sc*/ .dPmZyJ[data-label-wrap="true"] [data-component="buttonContent"]{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;padding-block:calc(var(--control-medium-paddingBlock,0.375rem) - 2px);}/*!sc*/ .dPmZyJ[data-label-wrap="true"] [data-component="text"]{white-space:unset;word-break:break-word;}/*!sc*/ .dPmZyJ[data-label-wrap="true"][data-size="small"]{height:unset;min-height:var(--control-small-size,1.75rem);}/*!sc*/ .dPmZyJ[data-label-wrap="true"][data-size="small"] [data-component="buttonContent"]{padding-block:calc(var(--control-small-paddingBlock,0.25rem) - 2px);}/*!sc*/ .dPmZyJ[data-label-wrap="true"][data-size="large"]{height:unset;min-height:var(--control-large-size,2.5rem);padding-inline:var(--control-large-paddingInline-spacious,1rem);}/*!sc*/ .dPmZyJ[data-label-wrap="true"][data-size="large"] [data-component="buttonContent"]{padding-block:calc(var(--control-large-paddingBlock,0.625rem) - 2px);}/*!sc*/ .dPmZyJ[data-inactive]:not([disabled]){background-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));border-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));color:var(--button-inactive-fgColor,var(--button-inactive-fgColor-rest,var(--color-btn-inactive-text,#57606a)));}/*!sc*/ .dPmZyJ[data-inactive]:not([disabled]):focus-visible{box-shadow:none;}/*!sc*/ .dPmZyJ [data-component="leadingVisual"]{grid-area:leadingVisual;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .dPmZyJ [data-component="text"]{grid-area:text;line-height:1.4285714;white-space:nowrap;}/*!sc*/ .dPmZyJ [data-component="trailingVisual"]{grid-area:trailingVisual;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .dPmZyJ [data-component="trailingAction"]{margin-right:-4px;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .dPmZyJ [data-component="buttonContent"]{-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;display:grid;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0,auto) min-content;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;}/*!sc*/ .dPmZyJ [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .dPmZyJ [data-component="loadingSpinner"]{grid-area:text;margin-right:0px !important;place-self:center;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .dPmZyJ [data-component="loadingSpinner"] + [data-component="text"]{visibility:hidden;}/*!sc*/ .dPmZyJ:hover:not([disabled]){background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg,rgba(208,215,222,0.32)));}/*!sc*/ .dPmZyJ:active:not([disabled]){background-color:var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg,rgba(208,215,222,0.48)));}/*!sc*/ .dPmZyJ[aria-expanded=true]{background-color:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg,rgba(208,215,222,0.24)));}/*!sc*/ .dPmZyJ[data-component="IconButton"][data-no-visuals]{color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .dPmZyJ[data-no-visuals]{color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));}/*!sc*/ .dPmZyJ:has([data-component="ButtonCounter"]){color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));}/*!sc*/ .dPmZyJ:disabled[data-no-visuals]{color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));}/*!sc*/ .dPmZyJ:disabled[data-no-visuals] [data-component=ButtonCounter]{color:inherit;}/*!sc*/ .gXPTqA{border-radius:6px;border:1px solid;border-color:transparent;font-family:inherit;font-weight:500;font-size:14px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-text-decoration:none;text-decoration:none;text-align:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;height:32px;padding:0 12px;gap:8px;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;-webkit-transition:80ms cubic-bezier(0.65,0,0.35,1);transition:80ms cubic-bezier(0.65,0,0.35,1);-webkit-transition-property:color,fill,background-color,border-color;transition-property:color,fill,background-color,border-color;color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));background-color:transparent;box-shadow:none;}/*!sc*/ .gXPTqA:focus:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .gXPTqA:focus:not(:disabled):not(:focus-visible){outline:solid 1px transparent;}/*!sc*/ .gXPTqA:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg,#0969da));outline-offset:-2px;}/*!sc*/ .gXPTqA[href]{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}/*!sc*/ .gXPTqA[href]:hover{-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .gXPTqA:hover{-webkit-transition-duration:80ms;transition-duration:80ms;}/*!sc*/ .gXPTqA:active{-webkit-transition:none;transition:none;}/*!sc*/ .gXPTqA[data-inactive]{cursor:auto;}/*!sc*/ .gXPTqA:disabled{cursor:not-allowed;box-shadow:none;color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));background-color:var(--button-invisible-bgColor-disabled,transparent);}/*!sc*/ .gXPTqA:disabled [data-component=ButtonCounter],.gXPTqA:disabled [data-component="leadingVisual"],.gXPTqA:disabled [data-component="trailingAction"]{color:inherit;}/*!sc*/ @media (forced-colors:active){.gXPTqA:focus{outline:solid 1px transparent;}}/*!sc*/ .gXPTqA [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .gXPTqA[data-component=IconButton]{display:inline-grid;padding:unset;place-content:center;width:32px;min-width:unset;}/*!sc*/ .gXPTqA[data-size="small"]{padding:0 8px;height:28px;gap:4px;font-size:12px;}/*!sc*/ .gXPTqA[data-size="small"] [data-component="text"]{line-height:1.6666667;}/*!sc*/ .gXPTqA[data-size="small"] [data-component=ButtonCounter]{font-size:12px;}/*!sc*/ .gXPTqA[data-size="small"] [data-component="buttonContent"] > :not(:last-child){margin-right:4px;}/*!sc*/ .gXPTqA[data-size="small"][data-component=IconButton]{width:28px;padding:unset;}/*!sc*/ .gXPTqA[data-size="large"]{padding:0 16px;height:40px;gap:8px;}/*!sc*/ .gXPTqA[data-size="large"] [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .gXPTqA[data-size="large"][data-component=IconButton]{width:40px;padding:unset;}/*!sc*/ .gXPTqA[data-block="block"]{width:100%;}/*!sc*/ .gXPTqA[data-label-wrap="true"]{min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;height:unset;min-height:var(--control-medium-size,2rem);}/*!sc*/ .gXPTqA[data-label-wrap="true"] [data-component="buttonContent"]{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;padding-block:calc(var(--control-medium-paddingBlock,0.375rem) - 2px);}/*!sc*/ .gXPTqA[data-label-wrap="true"] [data-component="text"]{white-space:unset;word-break:break-word;}/*!sc*/ .gXPTqA[data-label-wrap="true"][data-size="small"]{height:unset;min-height:var(--control-small-size,1.75rem);}/*!sc*/ .gXPTqA[data-label-wrap="true"][data-size="small"] [data-component="buttonContent"]{padding-block:calc(var(--control-small-paddingBlock,0.25rem) - 2px);}/*!sc*/ .gXPTqA[data-label-wrap="true"][data-size="large"]{height:unset;min-height:var(--control-large-size,2.5rem);padding-inline:var(--control-large-paddingInline-spacious,1rem);}/*!sc*/ .gXPTqA[data-label-wrap="true"][data-size="large"] [data-component="buttonContent"]{padding-block:calc(var(--control-large-paddingBlock,0.625rem) - 2px);}/*!sc*/ .gXPTqA[data-inactive]:not([disabled]){background-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));border-color:var(--button-inactive-bgColor,var(--button-inactive-bgColor-rest,var(--color-btn-inactive-bg,#eaeef2)));color:var(--button-inactive-fgColor,var(--button-inactive-fgColor-rest,var(--color-btn-inactive-text,#57606a)));}/*!sc*/ .gXPTqA[data-inactive]:not([disabled]):focus-visible{box-shadow:none;}/*!sc*/ .gXPTqA [data-component="leadingVisual"]{grid-area:leadingVisual;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gXPTqA [data-component="text"]{grid-area:text;line-height:1.4285714;white-space:nowrap;}/*!sc*/ .gXPTqA [data-component="trailingVisual"]{grid-area:trailingVisual;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gXPTqA [data-component="trailingAction"]{margin-right:-4px;color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gXPTqA [data-component="buttonContent"]{-webkit-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;display:grid;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0,auto) min-content;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;}/*!sc*/ .gXPTqA [data-component="buttonContent"] > :not(:last-child){margin-right:8px;}/*!sc*/ .gXPTqA [data-component="loadingSpinner"]{grid-area:text;margin-right:0px !important;place-self:center;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .gXPTqA [data-component="loadingSpinner"] + [data-component="text"]{visibility:hidden;}/*!sc*/ .gXPTqA:hover:not([disabled]){background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg,rgba(208,215,222,0.32)));}/*!sc*/ .gXPTqA:active:not([disabled]){background-color:var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg,rgba(208,215,222,0.48)));}/*!sc*/ .gXPTqA[aria-expanded=true]{background-color:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg,rgba(208,215,222,0.24)));}/*!sc*/ .gXPTqA[data-component="IconButton"][data-no-visuals]{color:var(--button-invisible-iconColor-rest,var(--fgColor-muted,var(--color-fg-muted,#656d76)));}/*!sc*/ .gXPTqA[data-no-visuals]{color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));}/*!sc*/ .gXPTqA:has([data-component="ButtonCounter"]){color:var(--button-invisible-fgColor-rest,var(--button-default-fgColor-rest,var(--color-btn-text,#24292f)));}/*!sc*/ .gXPTqA:disabled[data-no-visuals]{color:var(--fgColor-disabled,var(--color-primer-fg-disabled,#8c959f));}/*!sc*/ .gXPTqA:disabled[data-no-visuals] [data-component=ButtonCounter]{color:inherit;}/*!sc*/ .gXPTqA[data-size="medium"]{color:var(--fgColor-muted,var(--color-fg-subtle,#6e7781));padding-left:8px;padding-right:8px;}/*!sc*/ data-styled.g11[id="types__StyledButton-sc-ws60qy-0"]{content:"gVXRRg,loAzyw,cXsOlJ,gGdPyq,bmlmSe,dPmZyJ,gXPTqA,"}/*!sc*/ .hWlpPn{position:relative;display:inline-block;}/*!sc*/ .hWlpPn::after{position:absolute;z-index:1000000;display:none;padding:0.5em 0.75em;font:normal normal 11px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";-webkit-font-smoothing:subpixel-antialiased;color:var(--tooltip-fgColor,var(--fgColor-onEmphasis,var(--color-fg-on-emphasis,#ffffff)));text-align:center;-webkit-text-decoration:none;text-decoration:none;text-shadow:none;text-transform:none;-webkit-letter-spacing:normal;-moz-letter-spacing:normal;-ms-letter-spacing:normal;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:var(--tooltip-bgColor,var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)));border-radius:6px;opacity:0;}/*!sc*/ @-webkit-keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}/*!sc*/ @keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}/*!sc*/ .hWlpPn:hover::after,.hWlpPn:active::after,.hWlpPn:focus::after,.hWlpPn:focus-within::after{display:inline-block;-webkit-text-decoration:none;text-decoration:none;-webkit-animation-name:tooltip-appear;animation-name:tooltip-appear;-webkit-animation-duration:0.1s;animation-duration:0.1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-delay:0s;animation-delay:0s;}/*!sc*/ .hWlpPn.tooltipped-no-delay:hover::after,.hWlpPn.tooltipped-no-delay:active::after,.hWlpPn.tooltipped-no-delay:focus::after,.hWlpPn.tooltipped-no-delay:focus-within::after{-webkit-animation-delay:0s;animation-delay:0s;}/*!sc*/ .hWlpPn.tooltipped-multiline:hover::after,.hWlpPn.tooltipped-multiline:active::after,.hWlpPn.tooltipped-multiline:focus::after,.hWlpPn.tooltipped-multiline:focus-within::after{display:table-cell;}/*!sc*/ .hWlpPn.tooltipped-s::after,.hWlpPn.tooltipped-se::after,.hWlpPn.tooltipped-sw::after{top:100%;right:50%;margin-top:6px;}/*!sc*/ .hWlpPn.tooltipped-se::after{right:auto;left:50%;margin-left:-16px;}/*!sc*/ .hWlpPn.tooltipped-sw::after{margin-right:-16px;}/*!sc*/ .hWlpPn.tooltipped-n::after,.hWlpPn.tooltipped-ne::after,.hWlpPn.tooltipped-nw::after{right:50%;bottom:100%;margin-bottom:6px;}/*!sc*/ .hWlpPn.tooltipped-ne::after{right:auto;left:50%;margin-left:-16px;}/*!sc*/ .hWlpPn.tooltipped-nw::after{margin-right:-16px;}/*!sc*/ .hWlpPn.tooltipped-s::after,.hWlpPn.tooltipped-n::after{-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);}/*!sc*/ .hWlpPn.tooltipped-w::after{right:100%;bottom:50%;margin-right:6px;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%);}/*!sc*/ .hWlpPn.tooltipped-e::after{bottom:50%;left:100%;margin-left:6px;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%);}/*!sc*/ .hWlpPn.tooltipped-multiline::after{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate;}/*!sc*/ .hWlpPn.tooltipped-multiline.tooltipped-s::after,.hWlpPn.tooltipped-multiline.tooltipped-n::after{right:auto;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);}/*!sc*/ .hWlpPn.tooltipped-multiline.tooltipped-w::after,.hWlpPn.tooltipped-multiline.tooltipped-e::after{right:100%;}/*!sc*/ .hWlpPn.tooltipped-align-right-2::after{right:0;margin-right:0;}/*!sc*/ .hWlpPn.tooltipped-align-left-2::after{left:0;margin-left:0;}/*!sc*/ data-styled.g14[id="Tooltip__TooltipBase-sc-17tf59c-0"]{content:"hWlpPn,"}/*!sc*/ .kbCLEG{border:0;font-size:inherit;font-family:inherit;background-color:transparent;-webkit-appearance:none;color:inherit;width:100%;}/*!sc*/ .kbCLEG:focus{outline:0;}/*!sc*/ data-styled.g15[id="UnstyledTextInput-sc-14ypya-0"]{content:"kbCLEG,"}/*!sc*/ .liVpTx{display:inline-block;overflow:hidden;text-overflow:ellipsis;vertical-align:top;white-space:nowrap;max-width:125px;}/*!sc*/ data-styled.g17[id="Truncate__StyledTruncate-sc-23o1d2-0"]{content:"liVpTx,"}/*!sc*/ .iBVwpg{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-inline:var(--stack-padding-normal,16px);-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:var(--control-xlarge-size,48px);box-shadow:inset 0px -1px var(--borderColor-muted,var(--borderColor-muted,var(--color-border-muted,hsla(210,18%,87%,1))));-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;border-bottom:none;max-width:100%;padding-left:8px;padding-right:8px;}/*!sc*/ data-styled.g92[id="UnderlineTabbedInterface__StyledUnderlineWrapper-sc-4ilrg0-0"]{content:"iBVwpg,"}/*!sc*/ .gJyWUl{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;list-style:none;white-space:nowrap;padding:0;margin:0;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:8px;position:relative;}/*!sc*/ data-styled.g93[id="UnderlineTabbedInterface__StyledUnderlineItemList-sc-4ilrg0-1"]{content:"gJyWUl,"}/*!sc*/ .beOdPj{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:0;cursor:pointer;font:inherit;position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;color:var(--fgColor-default,var(--color-fg-default,#1F2328));text-align:center;-webkit-text-decoration:none;text-decoration:none;line-height:var(--text-body-lineHeight-medium,1.4285);border-radius:var(--borderRadius-medium,6px);font-size:var(--text-body-size-medium,14px);padding-inline:var(--control-medium-paddingInline-condensed,8px);padding-block:var(--control-medium-paddingBlock,6px);-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/ @media (hover:hover){.beOdPj:hover{background-color:var(--bgColor-neutral-muted,var(--bgColor-neutral-muted,var(--color-neutral-subtle,rgba(234,238,242,0.5))));-webkit-transition:background 0.12s ease-out;transition:background 0.12s ease-out;-webkit-text-decoration:none;text-decoration:none;}}/*!sc*/ .beOdPj:focus:{outline:2px solid transparent;box-shadow:inset 0 0 0 2px var(--fgColor-accent,var(--fgColor-accent,var(--color-accent-fg,#0969da)));}/*!sc*/ .beOdPj:focus::not(:focus-visible){box-shadow:none;}/*!sc*/ .beOdPj:focus-visible{outline:2px solid transparent;box-shadow:inset 0 0 0 2px var(--fgColor-accent,var(--fgColor-accent,var(--color-accent-fg,#0969da)));}/*!sc*/ .beOdPj [data-content]::before{content:attr(data-content);display:block;height:0;font-weight:var(--base-text-weight-semibold,500);visibility:hidden;white-space:nowrap;}/*!sc*/ .beOdPj [data-component='icon']{color:var(--fgColor-muted,var(--fgColor-muted,var(--color-fg-muted,#656d76)));-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;margin-inline-end:var(--control-medium-gap,8px);}/*!sc*/ .beOdPj [data-component='counter']{margin-inline-start:var(--control-medium-gap,8px);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/ .beOdPj::after{position:absolute;right:50%;bottom:calc(50% - calc(var(--control-xlarge-size,48px) / 2 + 1px));width:100%;height:2px;content:'';background-color:transparent;border-radius:0;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);}/*!sc*/ .beOdPj[aria-current]:not([aria-current='false']) [data-component='text'],.beOdPj[aria-selected='true'] [data-component='text']{font-weight:var(--base-text-weight-semibold,500);}/*!sc*/ .beOdPj[aria-current]:not([aria-current='false'])::after,.beOdPj[aria-selected='true']::after{background-color:var(--underlineNav-borderColor-active,var(--color-primer-border-active,#fd8c73));}/*!sc*/ @media (forced-colors:active){.beOdPj[aria-current]:not([aria-current='false'])::after,.beOdPj[aria-selected='true']::after{background-color:LinkText;}}/*!sc*/ data-styled.g94[id="UnderlineTabbedInterface__StyledUnderlineItem-sc-4ilrg0-2"]{content:"beOdPj,"}/*!sc*/ </style> <!-- --> <!-- --> <div class="Box-sc-g0xbh4-0 iVEunk"><div class="Box-sc-g0xbh4-0 jzuOtQ"><div class="Box-sc-g0xbh4-0 bGojzy"></div></div><div class="Box-sc-g0xbh4-0 iNSVHo"><div class="Box-sc-g0xbh4-0 bVgnfw"><div class="Box-sc-g0xbh4-0 CEgMp"><button type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-label="master branch" data-testid="anchor-button" class="types__StyledButton-sc-ws60qy-0 gVXRRg overview-ref-selector width-full" data-loading="false" data-size="medium" aria-describedby="branch-picker-repos-header-ref-selector-loading-announcement" id="branch-picker-repos-header-ref-selector"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg"><span data-component="text"><div class="Box-sc-g0xbh4-0 bZBlpz"><div class="Box-sc-g0xbh4-0 lhTYNA"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></div><div class="Box-sc-g0xbh4-0 ffLUq ref-selector-button-text-container"><span class="Text__StyledText-sc-17v1xeu-0 eMMFM"> <!-- -->master</span></div></div></span><span data-component="trailingVisual" class="Box-sc-g0xbh4-0 hzSPyu"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><button hidden="" data-hotkey-scope="read-only-cursor-text-area"></button></div><div class="Box-sc-g0xbh4-0 fLXEGX"><a style="--button-color:fg.muted" type="button" href="/MessagePack-CSharp/MessagePack-CSharp/branches" class="types__StyledButton-sc-ws60qy-0 loAzyw" data-loading="false" data-size="medium" aria-describedby=":Rclab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg"><span data-component="leadingVisual" class="Box-sc-g0xbh4-0 hzSPyu"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></span><span data-component="text">Branches</span></span></a><a style="--button-color:fg.muted" type="button" href="/MessagePack-CSharp/MessagePack-CSharp/tags" class="types__StyledButton-sc-ws60qy-0 loAzyw" data-loading="false" data-size="medium" aria-describedby=":Rklab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg"><span data-component="leadingVisual" class="Box-sc-g0xbh4-0 hzSPyu"><svg aria-hidden="true" focusable="false" class="octicon octicon-tag" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path></svg></span><span data-component="text">Tags</span></span></a></div><div class="Box-sc-g0xbh4-0 dqfxud"><a style="--button-color:fg.muted" type="button" aria-label="Go to Branches page" href="/MessagePack-CSharp/MessagePack-CSharp/branches" class="types__StyledButton-sc-ws60qy-0 cXsOlJ" data-loading="false" data-no-visuals="true" data-size="medium" aria-describedby=":Relab:-loading-announcement"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></a><a style="--button-color:fg.muted" type="button" aria-label="Go to Tags page" href="/MessagePack-CSharp/MessagePack-CSharp/tags" class="types__StyledButton-sc-ws60qy-0 cXsOlJ" data-loading="false" data-no-visuals="true" data-size="medium" aria-describedby=":Rmlab:-loading-announcement"><svg aria-hidden="true" focusable="false" class="octicon octicon-tag" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path></svg></a></div></div><div class="Box-sc-g0xbh4-0 jxTzTd"><div class="Box-sc-g0xbh4-0 gqqBXN"><div class="Box-sc-g0xbh4-0 dzXgxt"><!--$--><div class="Box-sc-g0xbh4-0 iWFGlI"><span class="TextInputWrapper__TextInputBaseWrapper-sc-1mqhpbi-0 TextInputWrapper-sc-1mqhpbi-1 gwqFqs decvaq TextInput-wrapper" aria-busy="false"><span class="TextInput-icon" id=":R2j5ab:" aria-hidden="true"><svg aria-hidden="true" focusable="false" class="octicon octicon-search" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></span><input type="text" aria-label="Go to file" role="combobox" aria-controls="file-results-list" aria-expanded="false" aria-haspopup="dialog" autoCorrect="off" spellcheck="false" placeholder="Go to file" aria-describedby=":R2j5ab: :R2j5abH1:" data-component="input" class="UnstyledTextInput-sc-14ypya-0 kbCLEG" value=""/><span class="TextInput-icon" id=":R2j5abH1:" aria-hidden="true"></span></span></div><!--/$--></div><div class="Box-sc-g0xbh4-0 YUPas"><button type="button" class="types__StyledButton-sc-ws60qy-0 gGdPyq" data-loading="false" data-no-visuals="true" data-size="medium" aria-describedby=":Rr5ab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg"><span data-component="text">Go to file</span></span></button></div><div class="react-directory-add-file-icon"></div><div class="react-directory-remove-file-icon"></div></div><button type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" class="types__StyledButton-sc-ws60qy-0 bmlmSe" data-loading="false" data-size="medium" aria-describedby=":R55ab:-loading-announcement" id=":R55ab:"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg"><span data-component="leadingVisual" class="Box-sc-g0xbh4-0 hzSPyu"><svg aria-hidden="true" focusable="false" class="hide-sm" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg></span><span data-component="text">Code</span><span data-component="trailingVisual" class="Box-sc-g0xbh4-0 hzSPyu"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><div class="Box-sc-g0xbh4-0 izFOf"><button data-component="IconButton" type="button" aria-label="Open more actions menu" aria-haspopup="true" aria-expanded="false" tabindex="0" class="types__StyledButton-sc-ws60qy-0 gGdPyq prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="medium" aria-describedby=":R75ab:-loading-announcement" id=":R75ab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button></div></div></div><div class="Box-sc-g0xbh4-0 vIPPs"><div data-hpc="true"><button hidden="" data-testid="focus-next-element-button" data-hotkey="j"></button><button hidden="" data-testid="focus-previous-element-button" data-hotkey="k"></button><h2 class="sr-only prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading" id="folders-and-files">Folders and files</h2><table aria-labelledby="folders-and-files" class="Box-sc-g0xbh4-0 fdROMU"><thead class="Box-sc-g0xbh4-0 jGKpsv"><tr class="Box-sc-g0xbh4-0 jdgHnn"><th colSpan="2" class="Box-sc-g0xbh4-0 bQivRW"><span class="text-bold">Name</span></th><th colSpan="1" class="Box-sc-g0xbh4-0 ldkMIO"><span class="text-bold">Name</span></th><th class="hide-sm"><div title="Last commit message" class="Truncate__StyledTruncate-sc-23o1d2-0 liVpTx width-fit"><span class="text-bold">Last commit message</span></div></th><th colSpan="1" class="Box-sc-g0xbh4-0 jMbWeI"><div title="Last commit date" class="Truncate__StyledTruncate-sc-23o1d2-0 liVpTx width-fit"><span class="text-bold">Last commit date</span></div></th></tr></thead><tbody><tr class="Box-sc-g0xbh4-0 gpqjiB"><td colSpan="3" class="bgColor-muted p-1 rounded-top-2"><div class="Box-sc-g0xbh4-0 dzCJzi"><h2 class="sr-only prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading">Latest commit</h2><div style="width:120px" class="Skeleton Skeleton--text" data-testid="loading"> </div><div class="d-flex flex-shrink-0 gap-2"><div data-testid="latest-commit-details" class="d-none d-sm-flex flex-items-center"></div><div class="d-flex gap-2"><h2 class="sr-only prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading">History</h2><a href="/MessagePack-CSharp/MessagePack-CSharp/commits/master/" class="types__StyledButton-sc-ws60qy-0 dPmZyJ d-none d-lg-flex LinkButton-module__code-view-link-button--xvCGA flex-items-center fgColor-default" data-loading="false" data-size="small" aria-describedby=":Raqj8pab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg"><span data-component="leadingVisual" class="Box-sc-g0xbh4-0 hzSPyu"><svg aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span><span data-component="text"><span class="fgColor-default">2,556 Commits</span></span></span></a><div class="d-sm-none"></div><div class="d-flex d-lg-none"><span role="tooltip" aria-label="2,556 Commits" id="history-icon-button-tooltip" class="Tooltip__TooltipBase-sc-17tf59c-0 hWlpPn tooltipped-n"><a href="/MessagePack-CSharp/MessagePack-CSharp/commits/master/" class="types__StyledButton-sc-ws60qy-0 dPmZyJ LinkButton-module__code-view-link-button--xvCGA flex-items-center fgColor-default" data-loading="false" data-size="small" aria-describedby=":R1iqj8pab:-loading-announcement history-icon-button-tooltip"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg"><span data-component="leadingVisual" class="Box-sc-g0xbh4-0 hzSPyu"><svg aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span></span></a></span></div></div></div></div></td></tr><tr class="react-directory-row undefined" id="folder-row-0"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".devcontainer" aria-label=".devcontainer, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/.devcontainer">.devcontainer</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".devcontainer" aria-label=".devcontainer, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/.devcontainer">.devcontainer</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-1"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".github" aria-label=".github, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/.github">.github</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".github" aria-label=".github, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/.github">.github</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-2"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".vscode" aria-label=".vscode, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/.vscode">.vscode</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".vscode" aria-label=".vscode, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/.vscode">.vscode</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-3"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="azure-pipelines" aria-label="azure-pipelines, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/azure-pipelines">azure-pipelines</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="azure-pipelines" aria-label="azure-pipelines, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/azure-pipelines">azure-pipelines</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-4"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="benchmark" aria-label="benchmark, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/benchmark">benchmark</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="benchmark" aria-label="benchmark, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/benchmark">benchmark</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-5"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="doc" aria-label="doc, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/doc">doc</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="doc" aria-label="doc, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/doc">doc</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-6"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="sandbox" aria-label="sandbox, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/sandbox">sandbox</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="sandbox" aria-label="sandbox, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/sandbox">sandbox</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-7"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="src" aria-label="src, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/src">src</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="src" aria-label="src, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/src">src</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-8"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="tests" aria-label="tests, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/tests">tests</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="tests" aria-label="tests, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/tests">tests</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-9"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="tools" aria-label="tools, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/tools">tools</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="tools" aria-label="tools, (Directory)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/tree/master/tools">tools</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-10"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".editorconfig" aria-label=".editorconfig, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/.editorconfig">.editorconfig</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".editorconfig" aria-label=".editorconfig, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/.editorconfig">.editorconfig</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-11"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".gitattributes" aria-label=".gitattributes, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/.gitattributes">.gitattributes</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".gitattributes" aria-label=".gitattributes, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/.gitattributes">.gitattributes</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-12"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".gitignore" aria-label=".gitignore, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/.gitignore">.gitignore</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".gitignore" aria-label=".gitignore, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/.gitignore">.gitignore</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-13"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="CONTRIBUTING.md" aria-label="CONTRIBUTING.md, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/CONTRIBUTING.md">CONTRIBUTING.md</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="CONTRIBUTING.md" aria-label="CONTRIBUTING.md, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/CONTRIBUTING.md">CONTRIBUTING.md</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-14"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="CONTRIBUTORS" aria-label="CONTRIBUTORS, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/CONTRIBUTORS">CONTRIBUTORS</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="CONTRIBUTORS" aria-label="CONTRIBUTORS, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/CONTRIBUTORS">CONTRIBUTORS</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-15"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Directory.Build.props" aria-label="Directory.Build.props, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/Directory.Build.props">Directory.Build.props</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Directory.Build.props" aria-label="Directory.Build.props, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/Directory.Build.props">Directory.Build.props</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-16"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Directory.Build.rsp" aria-label="Directory.Build.rsp, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/Directory.Build.rsp">Directory.Build.rsp</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Directory.Build.rsp" aria-label="Directory.Build.rsp, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/Directory.Build.rsp">Directory.Build.rsp</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-17"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Directory.Build.targets" aria-label="Directory.Build.targets, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/Directory.Build.targets">Directory.Build.targets</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Directory.Build.targets" aria-label="Directory.Build.targets, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/Directory.Build.targets">Directory.Build.targets</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-18"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Directory.Packages.props" aria-label="Directory.Packages.props, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/Directory.Packages.props">Directory.Packages.props</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Directory.Packages.props" aria-label="Directory.Packages.props, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/Directory.Packages.props">Directory.Packages.props</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-19"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="LICENSE" aria-label="LICENSE, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/LICENSE">LICENSE</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="LICENSE" aria-label="LICENSE, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/LICENSE">LICENSE</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-20"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="MessagePack.sln" aria-label="MessagePack.sln, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/MessagePack.sln">MessagePack.sln</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="MessagePack.sln" aria-label="MessagePack.sln, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/MessagePack.sln">MessagePack.sln</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-21"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="README.md" aria-label="README.md, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/README.md">README.md</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="README.md" aria-label="README.md, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/README.md">README.md</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-22"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="SECURITY.md" aria-label="SECURITY.md, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/SECURITY.md">SECURITY.md</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="SECURITY.md" aria-label="SECURITY.md, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/SECURITY.md">SECURITY.md</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-23"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="azure-pipelines.yml" aria-label="azure-pipelines.yml, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/azure-pipelines.yml">azure-pipelines.yml</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="azure-pipelines.yml" aria-label="azure-pipelines.yml, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/azure-pipelines.yml">azure-pipelines.yml</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-24"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="global.json" aria-label="global.json, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/global.json">global.json</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="global.json" aria-label="global.json, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/global.json">global.json</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-25"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="graph.xlsx" aria-label="graph.xlsx, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/graph.xlsx">graph.xlsx</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="graph.xlsx" aria-label="graph.xlsx, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/graph.xlsx">graph.xlsx</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-26"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="init.cmd" aria-label="init.cmd, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/init.cmd">init.cmd</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="init.cmd" aria-label="init.cmd, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/init.cmd">init.cmd</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-27"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="init.ps1" aria-label="init.ps1, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/init.ps1">init.ps1</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="init.ps1" aria-label="init.ps1, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/init.ps1">init.ps1</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-28"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="installcredprovider.ps1" aria-label="installcredprovider.ps1, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/installcredprovider.ps1">installcredprovider.ps1</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="installcredprovider.ps1" aria-label="installcredprovider.ps1, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/installcredprovider.ps1">installcredprovider.ps1</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-29"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="nuget.config" aria-label="nuget.config, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/nuget.config">nuget.config</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="nuget.config" aria-label="nuget.config, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/nuget.config">nuget.config</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-30"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="opensource.snk" aria-label="opensource.snk, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/opensource.snk">opensource.snk</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="opensource.snk" aria-label="opensource.snk, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/opensource.snk">opensource.snk</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-31"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="prepare_release.ps1" aria-label="prepare_release.ps1, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/prepare_release.ps1">prepare_release.ps1</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="prepare_release.ps1" aria-label="prepare_release.ps1, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/prepare_release.ps1">prepare_release.ps1</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-32"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="stylecop.json" aria-label="stylecop.json, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/stylecop.json">stylecop.json</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="stylecop.json" aria-label="stylecop.json, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/stylecop.json">stylecop.json</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-33"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="version.json" aria-label="version.json, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/version.json">version.json</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="version.json" aria-label="version.json, (File)" class="Link--primary" href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/version.json">version.json</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="Box-sc-g0xbh4-0 eNCcrz show-for-mobile" data-testid="view-all-files-row"><td colSpan="3" class="Box-sc-g0xbh4-0 bHTcCe"><div><button class="prc-Link-Link-85e08">View all files</button></div></td></tr></tbody></table></div><div class="Box-sc-g0xbh4-0 csrIcr"><div class="Box-sc-g0xbh4-0 bUQNHB"><div itemscope="" itemType="https://schema.org/abstract" class="Box-sc-g0xbh4-0 jPdcfu"><h2 class="_VisuallyHidden__VisuallyHidden-sc-11jhm7a-0 brGdpi">Repository files navigation</h2><nav aria-label="Repository files" class="UnderlineTabbedInterface__StyledUnderlineWrapper-sc-4ilrg0-0 iBVwpg"><ul role="list" class="UnderlineTabbedInterface__StyledUnderlineItemList-sc-4ilrg0-1 gJyWUl"><li class="Box-sc-g0xbh4-0 hUCRAk"><a href="#" aria-current="page" class="UnderlineTabbedInterface__StyledUnderlineItem-sc-4ilrg0-2 beOdPj"><span data-component="icon"><svg aria-hidden="true" focusable="false" class="octicon octicon-book" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path></svg></span><span data-component="text" data-content="README">README</span></a></li><li class="Box-sc-g0xbh4-0 hUCRAk"><a href="#" class="UnderlineTabbedInterface__StyledUnderlineItem-sc-4ilrg0-2 beOdPj"><span data-component="icon"><svg aria-hidden="true" focusable="false" class="octicon octicon-law" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path></svg></span><span data-component="text" data-content="License">License</span></a></li><li class="Box-sc-g0xbh4-0 hUCRAk"><a href="#" class="UnderlineTabbedInterface__StyledUnderlineItem-sc-4ilrg0-2 beOdPj"><span data-component="icon"><svg aria-hidden="true" focusable="false" class="octicon octicon-law" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path></svg></span><span data-component="text" data-content="Security">Security</span></a></li></ul></nav><button style="--button-color:fg.subtle" type="button" aria-label="Outline" aria-haspopup="true" aria-expanded="false" tabindex="0" class="types__StyledButton-sc-ws60qy-0 gXPTqA" data-loading="false" data-size="medium" aria-describedby=":Rr9ab:-loading-announcement" id=":Rr9ab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-list-unordered" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path d="M5.75 2.5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5ZM2 14a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM2 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg></button></div><div class="Box-sc-g0xbh4-0 QkQOb js-snippet-clipboard-copy-unpositioned" data-hpc="true"><article class="markdown-body entry-content container-lg" itemprop="text"><div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">MessagePack for C# (.NET Framework, .NET 6, Unity, Xamarin)</h1><a id="user-content-messagepack-for-c-net-framework-net-6-unity-xamarin" class="anchor" aria-label="Permalink: MessagePack for C# (.NET Framework, .NET 6, Unity, Xamarin)" href="#messagepack-for-c-net-framework-net-6-unity-xamarin"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><a href="https://www.nuget.org/packages/messagepack" rel="nofollow"><img src="https://camo.githubusercontent.com/09082ebaa79a847bd8269a3d1fcbd9f6bc7fbbbd91357d2729993c69be57e220/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f762f4d6573736167655061636b2e737667" alt="NuGet" data-canonical-src="https://img.shields.io/nuget/v/MessagePack.svg" style="max-width: 100%;"></a> <a href="https://www.nuget.org/packages/messagepack" rel="nofollow"><img src="https://camo.githubusercontent.com/22806bdc8d828044711400828521acd4979792542cd3c366f135881bbde0882f/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f767072652f4d6573736167655061636b2e737667" alt="NuGet" data-canonical-src="https://img.shields.io/nuget/vpre/MessagePack.svg" style="max-width: 100%;"></a> <a href="https://github.com/MessagePack-CSharp/MessagePack-CSharp/releases"><img src="https://camo.githubusercontent.com/7b9b29342c6578c18d13bc11879cdd4834eca5ac58aad8f8450bea327fd61509/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e65756563632f4d6573736167655061636b2d4353686172702e737667" alt="Releases" data-canonical-src="https://img.shields.io/github/release/neuecc/MessagePack-CSharp.svg" style="max-width: 100%;"></a></p> <p dir="auto"><a href="https://gitter.im/MessagePack-CSharp/Lobby?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge" rel="nofollow"><img src="https://camo.githubusercontent.com/3315156f6522eb055b3bf1711e139587acfc9d37e5a4f46c21cf2722305db534/68747470733a2f2f6261646765732e6769747465722e696d2f4d6573736167655061636b2d4353686172702f4c6f6262792e737667" alt="Join the chat at https://gitter.im/MessagePack-CSharp/Lobby" data-canonical-src="https://badges.gitter.im/MessagePack-CSharp/Lobby.svg" style="max-width: 100%;"></a> <a href="https://dev.azure.com/ils0086/MessagePack-CSharp/_build/latest?definitionId=2&amp;branchName=master" rel="nofollow"><img src="https://camo.githubusercontent.com/b5d651da8e13240e117223ba6806b31a774b5d8e06e33e73ea3c5e6c1991270d/68747470733a2f2f6465762e617a7572652e636f6d2f696c73303038362f4d6573736167655061636b2d4353686172702f5f617069732f6275696c642f7374617475732f4d6573736167655061636b2d4353686172702d43493f6272616e63684e616d653d6d6173746572" alt="Build Status" data-canonical-src="https://dev.azure.com/ils0086/MessagePack-CSharp/_apis/build/status/MessagePack-CSharp-CI?branchName=master" style="max-width: 100%;"></a></p> <p dir="auto">The extremely fast <a href="http://msgpack.org/" rel="nofollow">MessagePack</a> serializer for C#. It is 10x faster than <a href="https://github.com/msgpack/msgpack-cli">MsgPack-Cli</a> and outperforms other C# serializers. MessagePack for C# also ships with built-in support for LZ4 compression - an extremely fast compression algorithm. Performance is important, particularly in applications like games, distributed computing, microservices, or data caches.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/46207/23835716/89c8ab08-07af-11e7-9183-9e9415bdc87f.png"><img src="https://cloud.githubusercontent.com/assets/46207/23835716/89c8ab08-07af-11e7-9183-9e9415bdc87f.png" alt="Perf comparison graph" style="max-width: 100%;"></a></p> <p dir="auto">MessagePack has a compact binary size and a full set of general purpose expressive data types. Please have a look at the <a href="#comparison">comparison with JSON, protobuf, ZeroFormatter section</a> and learn <a href="#performance">why MessagePack C# is the fastest</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Table of Contents</h2><a id="user-content-table-of-contents" class="anchor" aria-label="Permalink: Table of Contents" href="#table-of-contents"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul dir="auto"> <li><a href="#installation">Installation</a> <ul dir="auto"> <li><a href="#nuget-packages">NuGet packages</a></li> <li><a href="#unity">Unity</a></li> <li><a href="#migration-notes-from-v1x">Migration notes from v1.x</a></li> </ul> </li> <li><a href="#quick-start">Quick Start</a></li> <li><a href="#analyzer">Analyzer</a></li> <li><a href="#built-in-supported-types">Built-in supported types</a></li> <li><a href="#object-serialization">Object Serialization</a></li> <li><a href="#datacontract-compatibility">DataContract compatibility</a></li> <li><a href="#serializing-readonlyimmutable-object-members--serializationconstructor">Serializing readonly/immutable object members (SerializationConstructor)</a></li> <li><a href="#serialization-callback">Serialization Callback</a></li> <li><a href="#union">Union</a></li> <li><a href="#dynamic-untyped-deserialization">Dynamic (Untyped) Deserialization</a></li> <li><a href="#object-type-serialization">Object Type Serialization</a></li> <li><a href="#typeless">Typeless</a></li> <li><a href="#security">Security</a></li> <li><a href="#performance">Performance</a> <ul dir="auto"> <li><a href="#deserialization-performance-for-different-options">Deserialization Performance for different options</a></li> <li><a href="#string-interning">String interning</a></li> </ul> </li> <li><a href="#lz4-compression">LZ4 Compression</a> <ul dir="auto"> <li><a href="#attributions">Attributions</a></li> </ul> </li> <li><a href="#comparison-with-protobuf-json-zeroformatter">Comparison with protobuf, JSON, ZeroFormatter</a></li> <li><a href="#hints-to-achieve-maximum-performance-when-using-messagepack-for-c">Hints to achieve maximum performance when using MessagePack for C#</a> <ul dir="auto"> <li><a href="#use-indexed-keys-instead-of-string-keys-contractless">Use indexed keys instead of string keys (Contractless)</a></li> <li><a href="#create-own-custom-composite-resolver">Create own custom composite resolver</a></li> <li><a href="#use-native-resolvers">Use native resolvers</a></li> <li><a href="#be-careful-when-copying-buffers">Be careful when copying buffers</a></li> <li><a href="#choosing-compression">Choosing compression</a></li> </ul> </li> <li><a href="#extensions">Extensions</a></li> <li><a href="#experimental-features">Experimental Features</a></li> <li><a href="#high-level-api-messagepackserializer">High-Level API (<code>MessagePackSerializer</code>)</a> <ul dir="auto"> <li><a href="#multiple-messagepack-structures-on-a-single-stream">Multiple MessagePack structures on a single <code>Stream</code></a></li> </ul> </li> <li><a href="#low-level-api-imessagepackformattert">Low-Level API (<code>IMessagePackFormatter&lt;T&gt;</code>)</a></li> <li><a href="#primitive-api-messagepackwriter-messagepackreader">Primitive API (<code>MessagePackWriter</code>, <code>MessagePackReader</code>)</a> <ul dir="auto"> <li><a href="#messagepackreader"><code>MessagePackReader</code></a></li> <li><a href="#messagepackwriter"><code>MessagePackWriter</code></a></li> </ul> </li> <li><a href="#main-extension-point-iformatterresolver">Main Extension Point (<code>IFormatterResolver</code>)</a></li> <li><a href="#messagepackformatterattribute">MessagePackFormatterAttribute</a></li> <li><a href="#ignoreformatter">IgnoreFormatter</a></li> <li><a href="#reserved-extension-types">Reserved Extension Types</a></li> <li><a href="#unity-support">Unity support</a></li> <li><a href="#aot-code-generation-support-for-unityxamarin">AOT Code Generation (support for Unity/Xamarin)</a></li> <li><a href="#rpc">RPC</a> <ul dir="auto"> <li><a href="#magiconion">MagicOnion</a></li> <li><a href="#streamjsonrpc">StreamJsonRpc</a></li> </ul> </li> <li><a href="#how-to-build">How to build</a></li> <li><a href="#author-info">Author Info</a></li> <li><a href="#coc">Code of Conduct &amp; .NET Foundation notice</a></li> </ul> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Installation</h2><a id="user-content-installation" class="anchor" aria-label="Permalink: Installation" href="#installation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This library is distributed via NuGet. Special <a href="#unity">Unity support</a> is available, too.</p> <p dir="auto">We target .NET Standard 2.0 with special optimizations for .NET 6+, making it compatible with most reasonably recent .NET runtimes such as Core 2.0 and later, Framework 4.6.1 and later, Mono 5.4 and later and Unity 2018.3 and later. The library code is pure C# (with Just-In-Time IL code generation on some platforms).</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">NuGet packages</h3><a id="user-content-nuget-packages" class="anchor" aria-label="Permalink: NuGet packages" href="#nuget-packages"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">To install with NuGet, just install the <code>MessagePack</code> package:</p> <div class="highlight highlight-source-powershell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Install-Package MessagePack"><pre><span class="pl-c1">Install-Package</span> MessagePack</pre></div> <p dir="auto">Install the optional C# <a href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/doc/analyzers/index.md">analyzers</a> package to get warnings about coding mistakes and automatic fix suggestions to save you time:</p> <div class="highlight highlight-source-powershell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Install-Package MessagePackAnalyzer"><pre><span class="pl-c1">Install-Package</span> MessagePackAnalyzer</pre></div> <p dir="auto">There are also a range of official and third party Extension Packages available (learn more in our <a href="#extensions">extensions section</a>):</p> <div class="highlight highlight-source-powershell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Install-Package MessagePack.ReactiveProperty Install-Package MessagePack.UnityShims Install-Package MessagePack.AspNetCoreMvcFormatter"><pre><span class="pl-c1">Install-Package</span> MessagePack.ReactiveProperty <span class="pl-c1">Install-Package</span> MessagePack.UnityShims <span class="pl-c1">Install-Package</span> MessagePack.AspNetCoreMvcFormatter</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Unity</h3><a id="user-content-unity" class="anchor" aria-label="Permalink: Unity" href="#unity"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">For Unity projects, the <a href="https://github.com/MessagePack-CSharp/MessagePack-CSharp/releases">Releases</a> page provides downloadable <code>.unitypackage</code> files. When using in Unity IL2CPP or Xamarin AOT environments, please carefully read the <a href="#aot">pre-code generation section</a>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Migration notes from v1.x</h3><a id="user-content-migration-notes-from-v1x" class="anchor" aria-label="Permalink: Migration notes from v1.x" href="#migration-notes-from-v1x"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">If you were using MessagePack for C# v1.x, check out the <a href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/doc/migration.md">"How to update to our new v2.x version"</a> document.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Quick Start</h2><a id="user-content-quick-start" class="anchor" aria-label="Permalink: Quick Start" href="#quick-start"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Define the struct or class to be serialized and annotate it with a <code>[MessagePackObject]</code> attribute. Annotate members whose values should be serialized (fields as well as properties) with <code>[Key]</code> attributes.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackObject] public class MyClass { // Key attributes take a serialization index (or string name) // The values must be unique and versioning has to be considered as well. // Keys are described in later sections in more detail. [Key(0)] public int Age { get; set; } [Key(1)] public string FirstName { get; set; } [Key(2)] public string LastName { get; set; } // All fields or properties that should not be serialized must be annotated with [IgnoreMember]. [IgnoreMember] public string FullName { get { return FirstName + LastName; } } }"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MyClass</span> <span class="pl-kos">{</span> <span class="pl-c">// Key attributes take a serialization index (or string name)</span> <span class="pl-c">// The values must be unique and versioning has to be considered as well.</span> <span class="pl-c">// Keys are described in later sections in more detail.</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Age</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">string</span> <span class="pl-s1">FirstName</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">string</span> <span class="pl-s1">LastName</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-c">// All fields or properties that should not be serialized must be annotated with [IgnoreMember].</span> <span class="pl-kos">[</span><span class="pl-c1">IgnoreMember</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">string</span> <span class="pl-s1">FullName</span> <span class="pl-kos">{</span> <span class="pl-k">get</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">FirstName</span> <span class="pl-c1">+</span> <span class="pl-s1">LastName</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">Call <code>MessagePackSerializer.Serialize&lt;T&gt;/Deserialize&lt;T&gt;</code> to serialize/deserialize your object instance. You can use the <code>ConvertToJson</code> method to get a human readable representation of any MessagePack binary blob.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Program { static void Main(string[] args) { var mc = new MyClass { Age = 99, FirstName = &quot;hoge&quot;, LastName = &quot;huga&quot;, }; // Call Serialize/Deserialize, that's all. byte[] bytes = MessagePackSerializer.Serialize(mc); MyClass mc2 = MessagePackSerializer.Deserialize&lt;MyClass&gt;(bytes); // You can dump MessagePack binary blobs to human readable json. // Using indexed keys (as opposed to string keys) will serialize to MessagePack arrays, // hence property names are not available. // [99,&quot;hoge&quot;,&quot;huga&quot;] var json = MessagePackSerializer.ConvertToJson(bytes); Console.WriteLine(json); } }"><pre><span class="pl-k">class</span> <span class="pl-smi">Program</span> <span class="pl-kos">{</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-smi">void</span> <span class="pl-en">Main</span><span class="pl-kos">(</span><span class="pl-smi">string</span><span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-s1">args</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">var</span> <span class="pl-s1">mc</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> MyClass <span class="pl-kos">{</span> <span class="pl-s1">Age</span> <span class="pl-c1">=</span> <span class="pl-c1">99</span><span class="pl-kos">,</span> <span class="pl-s1">FirstName</span> <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>hoge<span class="pl-s">"</span></span><span class="pl-kos">,</span> <span class="pl-s1">LastName</span> <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>huga<span class="pl-s">"</span></span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Call Serialize/Deserialize, that's all.</span> <span class="pl-smi">byte</span><span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-s1">bytes</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>mc<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">MyClass</span> <span class="pl-s1">mc2</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">MyClass</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>bytes<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// You can dump MessagePack binary blobs to human readable json.</span> <span class="pl-c">// Using indexed keys (as opposed to string keys) will serialize to MessagePack arrays,</span> <span class="pl-c">// hence property names are not available.</span> <span class="pl-c">// [99,"hoge","huga"]</span> <span class="pl-smi">var</span> <span class="pl-s1">json</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">ConvertToJson</span><span class="pl-kos">(</span>bytes<span class="pl-kos">)</span><span class="pl-kos">;</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>json<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">By default, a <code>MessagePackObject</code> annotation is required. This can be made optional; see the <a href="#object-serialization">Object Serialization section</a> and the <a href="#resolvers">Formatter Resolver section</a> for details.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Analyzer</h2><a id="user-content-analyzer" class="anchor" aria-label="Permalink: Analyzer" href="#analyzer"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The MessagePackAnalyzer package aids with:</p> <ol dir="auto"> <li>Automating definitions for your serializable objects.</li> <li>Produces compiler warnings upon incorrect attribute use, member accessibility, and more.</li> </ol> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/46207/23837445/ce734eae-07cb-11e7-9758-d69f0f095bc1.gif"><img src="https://cloud.githubusercontent.com/assets/46207/23837445/ce734eae-07cb-11e7-9758-d69f0f095bc1.gif" alt="analyzergif" data-animated-image="" style="max-width: 100%;"></a></p> <p dir="auto">If you want to allow a specific custom type (for example, when registering a custom type), put <code>MessagePackAnalyzer.json</code> at the project root and change the Build Action to <code>AdditionalFiles</code>.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/46207/23837427/8a8d507c-07cb-11e7-9277-5a566eb0bfde.png"><img src="https://cloud.githubusercontent.com/assets/46207/23837427/8a8d507c-07cb-11e7-9277-5a566eb0bfde.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">An example <code>MessagePackAnalyzer.json</code>:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[ &quot;MyNamespace.FooClass&quot;, &quot;MyNameSpace.BarStruct&quot; ]"><pre>[ <span class="pl-s"><span class="pl-pds">"</span>MyNamespace.FooClass<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>MyNameSpace.BarStruct<span class="pl-pds">"</span></span> ]</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Built-in supported types</h2><a id="user-content-built-in-supported-types" class="anchor" aria-label="Permalink: Built-in supported types" href="#built-in-supported-types"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">These types can serialize by default:</p> <ul dir="auto"> <li>Primitives (<code>int</code>, <code>string</code>, etc...), <code>Enum</code>s, <code>Nullable&lt;&gt;</code>, <code>Lazy&lt;&gt;</code></li> <li><code>TimeSpan</code>, <code>DateTime</code>, <code>DateTimeOffset</code></li> <li><code>Guid</code>, <code>Uri</code>, <code>Version</code>, <code>StringBuilder</code></li> <li><code>BigInteger</code>, <code>Complex</code>, <code>Half</code></li> <li><code>Array[]</code>, <code>Array[,]</code>, <code>Array[,,]</code>, <code>Array[,,,]</code>, <code>ArraySegment&lt;&gt;</code>, <code>BitArray</code></li> <li><code>KeyValuePair&lt;,&gt;</code>, <code>Tuple&lt;,...&gt;</code>, <code>ValueTuple&lt;,...&gt;</code></li> <li><code>ArrayList</code>, <code>Hashtable</code></li> <li><code>List&lt;&gt;</code>, <code>LinkedList&lt;&gt;</code>, <code>Queue&lt;&gt;</code>, <code>Stack&lt;&gt;</code>, <code>HashSet&lt;&gt;</code>, <code>ReadOnlyCollection&lt;&gt;</code>, <code>SortedList&lt;,&gt;</code></li> <li><code>IList&lt;&gt;</code>, <code>ICollection&lt;&gt;</code>, <code>IEnumerable&lt;&gt;</code>, <code>IReadOnlyCollection&lt;&gt;</code>, <code>IReadOnlyList&lt;&gt;</code></li> <li><code>Dictionary&lt;,&gt;</code>, <code>IDictionary&lt;,&gt;</code>, <code>SortedDictionary&lt;,&gt;</code>, <code>ILookup&lt;,&gt;</code>, <code>IGrouping&lt;,&gt;</code>, <code>ReadOnlyDictionary&lt;,&gt;</code>, <code>IReadOnlyDictionary&lt;,&gt;</code></li> <li><code>ObservableCollection&lt;&gt;</code>, <code>ReadOnlyObservableCollection&lt;&gt;</code></li> <li><code>ISet&lt;&gt;</code>,</li> <li><code>ConcurrentBag&lt;&gt;</code>, <code>ConcurrentQueue&lt;&gt;</code>, <code>ConcurrentStack&lt;&gt;</code>, <code>ConcurrentDictionary&lt;,&gt;</code></li> <li>Immutable collections (<code>ImmutableList&lt;&gt;</code>, etc)</li> <li>Custom implementations of <code>ICollection&lt;&gt;</code> or <code>IDictionary&lt;,&gt;</code> with a parameterless constructor</li> <li>Custom implementations of <code>IList</code> or <code>IDictionary</code> with a parameterless constructor</li> </ul> <p dir="auto">You can add support for custom types, and there are some official/third-party extension packages for:</p> <ul dir="auto"> <li>ReactiveProperty</li> <li>for Unity (<code>Vector3</code>, <code>Quaternion</code>, etc...)</li> <li>F# (Record, FsList, Discriminated Unions, etc...)</li> </ul> <p dir="auto">Please see the <a href="#extensions">extensions section</a>.</p> <p dir="auto"><code>MessagePack.Nil</code> is the built-in type representing null/void in MessagePack for C#.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Object Serialization</h2><a id="user-content-object-serialization" class="anchor" aria-label="Permalink: Object Serialization" href="#object-serialization"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePack for C# can serialize your own public <code>class</code> or <code>struct</code> types. By default, serializable types must be annotated with the <code>[MessagePackObject]</code> attribute and members with the <code>[Key]</code> attribute. Keys can be either indexes (<code>int</code>) or arbitrary strings. If all keys are indexes, arrays are used for serialization, which offers advantages in performance and binary size. Otherwise, MessagePack maps (dictionaries) will be used.</p> <p dir="auto">If you use <code>[MessagePackObject(keyAsPropertyName: true)]</code>, then members do not require explicit <code>Key</code> attributes, but string keys will be used.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackObject] public class Sample1 { [Key(0)] public int Foo { get; set; } [Key(1)] public int Bar { get; set; } } [MessagePackObject] public class Sample2 { [Key(&quot;foo&quot;)] public int Foo { get; set; } [Key(&quot;bar&quot;)] public int Bar { get; set; } } [MessagePackObject(keyAsPropertyName: true)] public class Sample3 { // No need for a Key attribute public int Foo { get; set; } // If want to ignore a public member, you can use the IgnoreMember attribute [IgnoreMember] public int Bar { get; set; } } // [10,20] Console.WriteLine(MessagePackSerializer.SerializeToJson(new Sample1 { Foo = 10, Bar = 20 })); // {&quot;foo&quot;:10,&quot;bar&quot;:20} Console.WriteLine(MessagePackSerializer.SerializeToJson(new Sample2 { Foo = 10, Bar = 20 })); // {&quot;Foo&quot;:10} Console.WriteLine(MessagePackSerializer.SerializeToJson(new Sample3 { Foo = 10, Bar = 20 }));"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Sample1</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Foo</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Bar</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Sample2</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>foo<span class="pl-s">"</span></span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Foo</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>bar<span class="pl-s">"</span></span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Bar</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject<span class="pl-kos">(</span>keyAsPropertyName<span class="pl-c1">:</span> <span class="pl-c1">true</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Sample3</span> <span class="pl-kos">{</span> <span class="pl-c">// No need for a Key attribute</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Foo</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-c">// If want to ignore a public member, you can use the IgnoreMember attribute</span> <span class="pl-kos">[</span><span class="pl-c1">IgnoreMember</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Bar</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-c">// [10,20]</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span>SerializeToJson<span class="pl-kos">(</span>new Sample1 <span class="pl-kos">{</span> Foo <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">,</span> Bar <span class="pl-c1">=</span> <span class="pl-c1">20</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// {"foo":10,"bar":20}</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span>SerializeToJson<span class="pl-kos">(</span>new Sample2 <span class="pl-kos">{</span> Foo <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">,</span> Bar <span class="pl-c1">=</span> <span class="pl-c1">20</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// {"Foo":10}</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span>SerializeToJson<span class="pl-kos">(</span>new Sample3 <span class="pl-kos">{</span> Foo <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">,</span> Bar <span class="pl-c1">=</span> <span class="pl-c1">20</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-kos"></span></pre></div> <p dir="auto">All public instance members (fields as well as properties) will be serialized. If you want to ignore certain public members, annotate the member with a <code>[IgnoreMember]</code> attribute.</p> <p dir="auto">Please note that any serializable struct or class must have public accessibility; private and internal structs and classes cannot be serialized! The default of requiring <code>MessagePackObject</code> annotations is meant to enforce explicitness and therefore may help write more robust code.</p> <p dir="auto">Should you use an indexed (<code>int</code>) key or a string key? We recommend using indexed keys for faster serialization and a more compact binary representation than string keys. However, the additional information in the strings of string keys can be quite useful when debugging.</p> <p dir="auto">When classes change or are extended, be careful about versioning. <code>MessagePackSerializer</code> will initialize members to their <code>default</code> value if a key does not exist in the serialized binary blob, meaning members using reference types can be initialized to <code>null</code>. If you use indexed (<code>int</code>) keys, the keys should start at 0 and should be sequential. If a later version stops using certain members, you should keep the obsolete members (C# provides an <code>Obsolete</code> attribute to annotate such members) until all other clients had a chance to update and remove their uses of these members as well. Also, when the values of indexed keys "jump" a lot, leaving gaps in the sequence, it will negatively affect the binary size, as <code>null</code> placeholders will be inserted into the resulting arrays. However, you shouldn't reuse indexes of removed members to avoid compatibility issues between clients or when trying to deserialize legacy blobs.</p> <p dir="auto">Example of index gaps and resulting placeholders:</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackObject] public class IntKeySample { [Key(3)] public int A { get; set; } [Key(10)] public int B { get; set; } } // [null,null,null,0,null,null,null,null,null,null,0] Console.WriteLine(MessagePackSerializer.SerializeToJson(new IntKeySample()));"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">IntKeySample</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">A</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">10</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">B</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-c">// [null,null,null,0,null,null,null,null,null,null,0]</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span>SerializeToJson<span class="pl-kos">(</span>new IntKeySample<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-kos"></span></pre></div> <p dir="auto">If you do not want to explicitly annotate with the <code>MessagePackObject</code>/<code>Key</code> attributes and instead want to use MessagePack for C# more like e.g. <a href="https://github.com/JamesNK/Newtonsoft.Json">Json.NET</a>, you can make use of the contractless resolver.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class ContractlessSample { public int MyProperty1 { get; set; } public int MyProperty2 { get; set; } } var data = new ContractlessSample { MyProperty1 = 99, MyProperty2 = 9999 }; var bin = MessagePackSerializer.Serialize( data, MessagePack.Resolvers.ContractlessStandardResolver.Options); // {&quot;MyProperty1&quot;:99,&quot;MyProperty2&quot;:9999} Console.WriteLine(MessagePackSerializer.ConvertToJson(bin)); // You can also set ContractlessStandardResolver as the default. // (Global state; Not recommended when writing library code) MessagePackSerializer.DefaultOptions = MessagePack.Resolvers.ContractlessStandardResolver.Options; // Now serializable... var bin2 = MessagePackSerializer.Serialize(data);"><pre><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">ContractlessSample</span> <span class="pl-kos">{</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">MyProperty1</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">MyProperty2</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-smi">var</span> <span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> ContractlessSample <span class="pl-kos">{</span> <span class="pl-s1">MyProperty1</span> <span class="pl-c1">=</span> <span class="pl-c1">99</span><span class="pl-kos">,</span> <span class="pl-s1">MyProperty2</span> <span class="pl-c1">=</span> <span class="pl-c1">9999</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">bin</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span> data<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>ContractlessStandardResolver<span class="pl-kos">.</span>Options<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// {"MyProperty1":99,"MyProperty2":9999}</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span>ConvertToJson<span class="pl-kos">(</span>bin<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// You can also set ContractlessStandardResolver as the default.</span> <span class="pl-c">// (Global state; Not recommended when writing library code)</span> MessagePackSerializer<span class="pl-kos">.</span>DefaultOptions<span class="pl-s1"></span> <span class="pl-c1">=</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>ContractlessStandardResolver<span class="pl-kos">.</span>Options<span class="pl-kos">;</span> <span class="pl-c">// Now serializable...</span> <span class="pl-smi">var</span> <span class="pl-s1">bin2</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>data<span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-kos"></span></pre></div> <p dir="auto">If you want to serialize private members as well, you can use one of the <code>*AllowPrivate</code> resolvers.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackObject] public class PrivateSample { [Key(0)] int x; public void SetX(int v) { x = v; } public int GetX() { return x; } } var data = new PrivateSample(); data.SetX(9999); // You can choose either StandardResolverAllowPrivate // or ContractlessStandardResolverAllowPrivate var bin = MessagePackSerializer.Serialize( data, MessagePack.Resolvers.DynamicObjectResolverAllowPrivate.Options);"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">PrivateSample</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-smi">int</span> <span class="pl-s1">x</span><span class="pl-kos">;</span> <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">SetX</span><span class="pl-kos">(</span><span class="pl-smi">int</span> <span class="pl-s1">v</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">v</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-en">GetX</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">x</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-smi">var</span> <span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> PrivateSample<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> data<span class="pl-kos">.</span>SetX<span class="pl-kos">(</span><span class="pl-c1">9999</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// You can choose either StandardResolverAllowPrivate</span> <span class="pl-c">// or ContractlessStandardResolverAllowPrivate</span> var bin <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span>Serialize<span class="pl-kos">(</span> data<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>DynamicObjectResolverAllowPrivate<span class="pl-kos">.</span>Options<span class="pl-kos">)</span><span class="pl-kos"></span><span class="pl-kos">;</span><span class="pl-kos"></span></pre></div> <p dir="auto">If you want to use MessagePack for C# more like a BinaryFormatter with a typeless serialization API, use the typeless resolver and helpers. Please consult the <a href="#typeless">Typeless section</a>.</p> <p dir="auto">Resolvers are the way to add specialized support for custom types to MessagePack for C#. Please refer to the <a href="#resolvers">Extension point section</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">DataContract compatibility</h2><a id="user-content-datacontract-compatibility" class="anchor" aria-label="Permalink: DataContract compatibility" href="#datacontract-compatibility"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You can use <code>[DataContract]</code> annotations instead of <code>[MessagePackObject]</code> ones. If type is annotated with <code>DataContract</code>, you can use <code>[DataMember]</code> annotations instead of <code>[Key]</code> ones and <code>[IgnoreDataMember]</code> instead of <code>[IgnoreMember]</code>.</p> <p dir="auto">Then <code>[DataMember(Order = int)]</code> will behave the same as <code>[Key(int)]</code>, <code>[DataMember(Name = string)]</code> the same as <code>[Key(string)]</code>, and <code>[DataMember]</code> the same as <code>[Key(nameof(member name)]</code>.</p> <p dir="auto">Using <code>DataContract</code>, e.g. in shared libraries, makes your classes/structs independent from MessagePack for C# serialization. However, it is not supported by the analyzers nor in code generation by the <code>mpc</code> tool. Also, features like <code>UnionAttribute</code>, <code>MessagePackFormatter</code>, <code>SerializationConstructor</code>, etc can not be used. Due to this, we recommend that you use the specific MessagePack for C# annotations when possible.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Serializing readonly/immutable object members (SerializationConstructor)</h2><a id="user-content-serializing-readonlyimmutable-object-members--serializationconstructor" class="anchor" aria-label="Permalink: Serializing readonly/immutable object members (SerializationConstructor)" href="#serializing-readonlyimmutable-object-members--serializationconstructor"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePack for C# supports serialization of readonly/immutable objects/members. For example, this struct can be serialized and deserialized.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackObject] public struct Point { [Key(0)] public readonly int X; [Key(1)] public readonly int Y; public Point(int x, int y) { this.X = x; this.Y = y; } } var data = new Point(99, 9999); var bin = MessagePackSerializer.Serialize(data); // Okay to deserialize immutable object var point = MessagePackSerializer.Deserialize&lt;Point&gt;(bin);"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">struct</span> <span class="pl-smi">Point</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">readonly</span> <span class="pl-smi">int</span> <span class="pl-s1">X</span><span class="pl-kos">;</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">readonly</span> <span class="pl-smi">int</span> <span class="pl-s1">Y</span><span class="pl-kos">;</span> <span class="pl-k">public</span> <span class="pl-v">Point</span><span class="pl-kos">(</span><span class="pl-smi">int</span> <span class="pl-s1">x</span><span class="pl-kos">,</span> <span class="pl-smi">int</span> <span class="pl-s1">y</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">this</span><span class="pl-kos">.</span>X <span class="pl-c1">=</span> <span class="pl-s1">x</span><span class="pl-kos">;</span> <span class="pl-k">this</span><span class="pl-kos">.</span>Y <span class="pl-c1">=</span> <span class="pl-s1">y</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-smi">var</span> <span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> Point<span class="pl-kos">(</span><span class="pl-c1">99</span><span class="pl-kos">,</span> <span class="pl-c1">9999</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">bin</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>data<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Okay to deserialize immutable object</span> <span class="pl-smi">var</span> <span class="pl-s1">point</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">Point</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>bin<span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-kos"></span></pre></div> <p dir="auto"><code>MessagePackSerializer</code> will choose the constructor with the best matched argument list, using argument indexes index for index keys, or parameter names for string keys. If it cannot determine an appropriate constructor, a <code>MessagePackDynamicObjectResolverException: can't find matched constructor parameter</code> exception will be thrown. You can specify which constructor to use manually with a <code>[SerializationConstructor]</code> annotation.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackObject] public struct Point { [Key(0)] public readonly int X; [Key(1)] public readonly int Y; [SerializationConstructor] public Point(int x) { this.X = x; this.Y = -1; } // If not marked attribute, used this(most matched argument) public Point(int x, int y) { this.X = x; this.Y = y; } }"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">struct</span> <span class="pl-smi">Point</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">readonly</span> <span class="pl-smi">int</span> <span class="pl-s1">X</span><span class="pl-kos">;</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">readonly</span> <span class="pl-smi">int</span> <span class="pl-s1">Y</span><span class="pl-kos">;</span> <span class="pl-kos">[</span><span class="pl-c1">SerializationConstructor</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-v">Point</span><span class="pl-kos">(</span><span class="pl-smi">int</span> <span class="pl-s1">x</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">this</span><span class="pl-kos">.</span>X <span class="pl-c1">=</span> <span class="pl-s1">x</span><span class="pl-kos">;</span> <span class="pl-k">this</span><span class="pl-kos">.</span>Y <span class="pl-c1">=</span> <span class="pl-c1">-</span><span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-c">// If not marked attribute, used this(most matched argument)</span> <span class="pl-k">public</span> <span class="pl-v">Point</span><span class="pl-kos">(</span><span class="pl-smi">int</span> <span class="pl-s1">x</span><span class="pl-kos">,</span> <span class="pl-smi">int</span> <span class="pl-s1">y</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">this</span><span class="pl-kos">.</span>X <span class="pl-c1">=</span> <span class="pl-s1">x</span><span class="pl-kos">;</span> <span class="pl-k">this</span><span class="pl-kos">.</span>Y <span class="pl-c1">=</span> <span class="pl-s1">y</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">C# 9 <code>record</code> types</h3><a id="user-content-c-9-record-types" class="anchor" aria-label="Permalink: C# 9 record types" href="#c-9-record-types"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">C# 9.0 record with primary constructor is similar immutable object, also supports serialize/deserialize.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// use key as property name [MessagePackObject(true)]public record Point(int X, int Y); // use property: to set KeyAttribute [MessagePackObject] public record Point([property:Key(0)] int X, [property: Key(1)] int Y); // Or use explicit properties [MessagePackObject] public record Person { [Key(0)] public string FirstName { get; init; } [Key(1)] public string LastName { get; init; } }"><pre><span class="pl-c">// use key as property name</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject<span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span><span class="pl-k">public</span> <span class="pl-k">record</span> <span class="pl-smi">Point</span><span class="pl-kos">(</span><span class="pl-smi">int</span> <span class="pl-s1">X</span><span class="pl-kos">,</span> <span class="pl-smi">int</span> <span class="pl-s1">Y</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// use property: to set KeyAttribute</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">record</span> <span class="pl-smi">Point</span><span class="pl-kos">(</span><span class="pl-kos">[</span>property<span class="pl-c1">:</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-smi">int</span> <span class="pl-s1">X</span><span class="pl-kos">,</span> <span class="pl-kos">[</span>property<span class="pl-c1">:</span> <span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-smi">int</span> <span class="pl-s1">Y</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Or use explicit properties</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">record</span> <span class="pl-smi">Person</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">string</span> <span class="pl-s1">FirstName</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">init</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">string</span> <span class="pl-s1">LastName</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">init</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">C# 9 <code>init</code> property setter limitations</h3><a id="user-content-c-9-init-property-setter-limitations" class="anchor" aria-label="Permalink: C# 9 init property setter limitations" href="#c-9-init-property-setter-limitations"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">When using <code>init</code> property setters in <em>generic</em> classes, <a href="https://github.com/neuecc/MessagePack-CSharp/issues/1134" data-hovercard-type="issue" data-hovercard-url="/MessagePack-CSharp/MessagePack-CSharp/issues/1134/hovercard">a CLR bug</a> prevents our most efficient code generation from invoking the property setter. As a result, you should avoid using <code>init</code> on property setters in generic classes when using the public-only <code>DynamicObjectResolver</code>/<code>StandardResolver</code>.</p> <p dir="auto">When using the <code>DynamicObjectResolverAllowPrivate</code>/<code>StandardResolverAllowPrivate</code> resolver the bug does not apply and you may use <code>init</code> without restriction.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Serialization Callback</h2><a id="user-content-serialization-callback" class="anchor" aria-label="Permalink: Serialization Callback" href="#serialization-callback"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Objects implementing the <code>IMessagePackSerializationCallbackReceiver</code> interface will received <code>OnBeforeSerialize</code> and <code>OnAfterDeserialize</code> calls during serialization/deserialization.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackObject] public class SampleCallback : IMessagePackSerializationCallbackReceiver { [Key(0)] public int Key { get; set; } public void OnBeforeSerialize() { Console.WriteLine(&quot;OnBefore&quot;); } public void OnAfterDeserialize() { Console.WriteLine(&quot;OnAfter&quot;); } }"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">SampleCallback</span> <span class="pl-c1">:</span> <span class="pl-smi">IMessagePackSerializationCallbackReceiver</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Key</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">OnBeforeSerialize</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>OnBefore<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">OnAfterDeserialize</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>OnAfter<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Union</h2><a id="user-content-union" class="anchor" aria-label="Permalink: Union" href="#union"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePack for C# supports serializing interface-typed and abstract class-typed objects. It behaves like <code>XmlInclude</code> or <code>ProtoInclude</code>. In MessagePack for C# these are called <code>Union</code>. Only interfaces and abstracts classes are allowed to be annotated with <code>Union</code> attributes. Unique union keys are required.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Annotate inheritance types [MessagePack.Union(0, typeof(FooClass))] [MessagePack.Union(1, typeof(BarClass))] public interface IUnionSample { } [MessagePackObject] public class FooClass : IUnionSample { [Key(0)] public int XYZ { get; set; } } [MessagePackObject] public class BarClass : IUnionSample { [Key(0)] public string OPQ { get; set; } } // --- IUnionSample data = new FooClass() { XYZ = 999 }; // Serialize interface-typed object. var bin = MessagePackSerializer.Serialize(data); // Deserialize again. var reData = MessagePackSerializer.Deserialize&lt;IUnionSample&gt;(bin); // Use with e.g. type-switching in C# 7.0 switch (reData) { case FooClass x: Console.WriteLine(x.XYZ); break; case BarClass x: Console.WriteLine(x.OPQ); break; default: break; }"><pre><span class="pl-c">// Annotate inheritance types</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePack<span class="pl-kos">.</span>Union<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">FooClass</span><span class="pl-kos">)</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePack<span class="pl-kos">.</span>Union<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">BarClass</span><span class="pl-kos">)</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">IUnionSample</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">FooClass</span> <span class="pl-c1">:</span> <span class="pl-smi">IUnionSample</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">XYZ</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">BarClass</span> <span class="pl-c1">:</span> <span class="pl-smi">IUnionSample</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">string</span> <span class="pl-s1">OPQ</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-c">// ---</span> <span class="pl-smi">IUnionSample</span> <span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> FooClass<span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">XYZ</span> <span class="pl-c1">=</span> <span class="pl-c1">999</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Serialize interface-typed object.</span> <span class="pl-smi">var</span> <span class="pl-s1">bin</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>data<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Deserialize again.</span> <span class="pl-smi">var</span> <span class="pl-s1">reData</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">IUnionSample</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>bin<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Use with e.g. type-switching in C# 7.0</span> <span class="pl-v">switch</span> <span class="pl-kos">(</span><span class="pl-s1">reData</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">case</span> <span class="pl-s1">FooClass</span><span class="pl-kos"></span> x<span class="pl-c1">:</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>x<span class="pl-kos">.</span>XYZ<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">break</span><span class="pl-kos">;</span> <span class="pl-smi">case</span> <span class="pl-s1">BarClass</span><span class="pl-kos"></span> x<span class="pl-c1">:</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>x<span class="pl-kos">.</span>OPQ<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">break</span><span class="pl-kos">;</span> <span class="pl-k">default</span><span class="pl-c1">:</span> <span class="pl-k">break</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos"></span></pre></div> <p dir="auto">Unions are internally serialized to two-element arrays.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="IUnionSample data = new BarClass { OPQ = &quot;FooBar&quot; }; var bin = MessagePackSerializer.Serialize(data); // Union is serialized to two-length array, [key, object] // [1,[&quot;FooBar&quot;]] Console.WriteLine(MessagePackSerializer.ConvertToJson(bin));"><pre><span class="pl-smi">IUnionSample</span> <span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> BarClass <span class="pl-kos">{</span> <span class="pl-s1">OPQ</span> <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>FooBar<span class="pl-s">"</span></span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">bin</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>data<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Union is serialized to two-length array, [key, object]</span> <span class="pl-c">// [1,["FooBar"]]</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">ConvertToJson</span><span class="pl-kos">(</span>bin<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Using <code>Union</code> with abstract classes works the same way.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[Union(0, typeof(SubUnionType1))] [Union(1, typeof(SubUnionType2))] [MessagePackObject] public abstract class ParentUnionType { [Key(0)] public int MyProperty { get; set; } } [MessagePackObject] public class SubUnionType1 : ParentUnionType { [Key(1)] public int MyProperty1 { get; set; } } [MessagePackObject] public class SubUnionType2 : ParentUnionType { [Key(1)] public int MyProperty2 { get; set; } }"><pre><span class="pl-kos">[</span><span class="pl-c1">Union<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">SubUnionType1</span><span class="pl-kos">)</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-kos">[</span><span class="pl-c1">Union<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">SubUnionType2</span><span class="pl-kos">)</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">abstract</span> <span class="pl-k">class</span> <span class="pl-smi">ParentUnionType</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">MyProperty</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">SubUnionType1</span> <span class="pl-c1">:</span> <span class="pl-smi">ParentUnionType</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">MyProperty1</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">SubUnionType2</span> <span class="pl-c1">:</span> <span class="pl-smi">ParentUnionType</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">MyProperty2</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">Please be mindful that you cannot reuse the same keys in derived types that are already present in the parent type, as internally a single flat array or map will be used and thus cannot have duplicate indexes/keys.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Dynamic (Untyped) Deserialization</h2><a id="user-content-dynamic-untyped-deserialization" class="anchor" aria-label="Permalink: Dynamic (Untyped) Deserialization" href="#dynamic-untyped-deserialization"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">When calling <code>MessagePackSerializer.Deserialize&lt;object&gt;</code> or <code>MessagePackSerializer.Deserialize&lt;dynamic&gt;</code>, any values present in the blob will be converted to primitive values, i.e. <code>bool</code>, <code>char</code>, <code>sbyte</code>, <code>byte</code>, <code>short</code>, <code>int</code>, <code>long</code>, <code>ushort</code>, <code>uint</code>, <code>ulong</code>, <code>float</code>, <code>double</code>, <code>DateTime</code>, <code>string</code>, <code>byte[]</code>, <code>object[]</code>, <code>IDictionary&lt;object, object&gt;</code>.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Sample blob. var model = new DynamicModel { Name = &quot;foobar&quot;, Items = new[] { 1, 10, 100, 1000 } }; var blob = MessagePackSerializer.Serialize(model, ContractlessStandardResolver.Options); // Dynamic (&quot;untyped&quot;) var dynamicModel = MessagePackSerializer.Deserialize&lt;dynamic&gt;(blob, ContractlessStandardResolver.Options); // You can access the data using array/dictionary indexers, as shown above Console.WriteLine(dynamicModel[&quot;Name&quot;]); // foobar Console.WriteLine(dynamicModel[&quot;Items&quot;][2]); // 100"><pre><span class="pl-c">// Sample blob.</span> <span class="pl-smi">var</span> <span class="pl-s1">model</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> DynamicModel <span class="pl-kos">{</span> <span class="pl-s1">Name</span> <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>foobar<span class="pl-s">"</span></span><span class="pl-kos">,</span> <span class="pl-s1">Items</span> <span class="pl-c1">=</span> <span class="pl-k">new</span><span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-kos">{</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-c1">100</span><span class="pl-kos">,</span> <span class="pl-c1">1000</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">blob</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>model<span class="pl-kos">,</span> ContractlessStandardResolver<span class="pl-kos">.</span>Options<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Dynamic ("untyped")</span> <span class="pl-smi">var</span> <span class="pl-s1">dynamicModel</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">dynamic</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>blob<span class="pl-kos">,</span> ContractlessStandardResolver<span class="pl-kos">.</span>Options<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// You can access the data using array/dictionary indexers, as shown above</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>dynamicModel<span class="pl-kos">[</span><span class="pl-s"><span class="pl-s">"</span>Name<span class="pl-s">"</span></span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// foobar</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>dynamicModel<span class="pl-kos">[</span><span class="pl-s"><span class="pl-s">"</span>Items<span class="pl-s">"</span></span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// 100</span></pre></div> <p dir="auto">Exploring object trees using the dictionary indexer syntax is the fastest option for untyped deserialization, but it is tedious to read and write. Where performance is not as important as code readability, consider deserializing with <a href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/doc/ExpandoObject.md">ExpandoObject</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Object Type Serialization</h2><a id="user-content-object-type-serialization" class="anchor" aria-label="Permalink: Object Type Serialization" href="#object-type-serialization"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><code>StandardResolver</code> and <code>ContractlessStandardResolver</code> can serialize <code>object</code>/anonymous typed objects.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var objects = new object[] { 1, &quot;aaa&quot;, new ObjectFieldType { Anything = 9999 } }; var bin = MessagePackSerializer.Serialize(objects); // [1,&quot;aaa&quot;,[9999]] Console.WriteLine(MessagePackSerializer.ConvertToJson(bin)); // Support anonymous Type Serialize var anonType = new { Foo = 100, Bar = &quot;foobar&quot; }; var bin2 = MessagePackSerializer.Serialize(anonType, MessagePack.Resolvers.ContractlessStandardResolver.Options); // {&quot;Foo&quot;:100,&quot;Bar&quot;:&quot;foobar&quot;} Console.WriteLine(MessagePackSerializer.ConvertToJson(bin2));"><pre><span class="pl-smi">var</span> <span class="pl-s1">objects</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">object</span><span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-kos">{</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s"><span class="pl-s">"</span>aaa<span class="pl-s">"</span></span><span class="pl-kos">,</span> <span class="pl-k">new</span> ObjectFieldType <span class="pl-kos">{</span> <span class="pl-s1">Anything</span> <span class="pl-c1">=</span> <span class="pl-c1">9999</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">bin</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>objects<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// [1,"aaa",[9999]]</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">ConvertToJson</span><span class="pl-kos">(</span>bin<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Support anonymous Type Serialize</span> <span class="pl-smi">var</span> <span class="pl-s1">anonType</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-kos">{</span> Foo <span class="pl-c1">=</span> <span class="pl-c1">100</span><span class="pl-kos">,</span> Bar <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>foobar<span class="pl-s">"</span></span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">bin2</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>anonType<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>ContractlessStandardResolver<span class="pl-kos">.</span>Options<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// {"Foo":100,"Bar":"foobar"}</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">ConvertToJson</span><span class="pl-kos">(</span>bin2<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <blockquote> <p dir="auto">Unity supports is limited.</p> </blockquote> <p dir="auto">When deserializing, the behavior will be the same as Dynamic (Untyped) Deserialization.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Typeless</h2><a id="user-content-typeless" class="anchor" aria-label="Permalink: Typeless" href="#typeless"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The typeless API is similar to <code>BinaryFormatter</code>, as it will embed type information into the blobs, so no types need to be specified explicitly when calling the API.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="object mc = new Sandbox.MyClass() { Age = 10, FirstName = &quot;hoge&quot;, LastName = &quot;huga&quot; }; // Serialize with the typeless API var blob = MessagePackSerializer.Typeless.Serialize(mc); // Blob has embedded type-assembly information. // [&quot;Sandbox.MyClass, Sandbox&quot;,10,&quot;hoge&quot;,&quot;huga&quot;] Console.WriteLine(MessagePackSerializer.ConvertToJson(bin)); // You can deserialize to MyClass again with the typeless API // Note that no type has to be specified explicitly in the Deserialize call // as type information is embedded in the binary blob var objModel = MessagePackSerializer.Typeless.Deserialize(bin) as MyClass;"><pre><span class="pl-smi">object</span> <span class="pl-s1">mc</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> Sandbox<span class="pl-kos">.</span>MyClass<span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">Age</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-s1">FirstName</span> <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>hoge<span class="pl-s">"</span></span><span class="pl-kos">,</span> <span class="pl-s1">LastName</span> <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>huga<span class="pl-s">"</span></span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Serialize with the typeless API</span> <span class="pl-smi">var</span> <span class="pl-s1">blob</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span>Typeless<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>mc<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Blob has embedded type-assembly information.</span> <span class="pl-c">// ["Sandbox.MyClass, Sandbox",10,"hoge","huga"]</span> Console<span class="pl-kos">.</span><span class="pl-en">WriteLine</span><span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">ConvertToJson</span><span class="pl-kos">(</span>bin<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// You can deserialize to MyClass again with the typeless API</span> <span class="pl-c">// Note that no type has to be specified explicitly in the Deserialize call</span> <span class="pl-c">// as type information is embedded in the binary blob</span> <span class="pl-smi">var</span> <span class="pl-s1">objModel</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span>Typeless<span class="pl-kos">.</span><span class="pl-en">Deserialize</span><span class="pl-kos">(</span>bin<span class="pl-kos">)</span> <span class="pl-k">as</span> MyClass<span class="pl-kos">;</span></pre></div> <p dir="auto">Type information is represented by the MessagePack <code>ext</code> format, type code <code>100</code>.</p> <p dir="auto"><code>MessagePackSerializer.Typeless</code> is a shortcut of <code>Serialize/Deserialize&lt;object&gt;(TypelessContractlessStandardResolver.Instance)</code>. If you want to configure it as the default resolver, you can use <code>MessagePackSerializer.Typeless.RegisterDefaultResolver</code>.</p> <p dir="auto"><code>TypelessFormatter</code> can used standalone or combined with other resolvers.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Replaced `object` uses the typeless resolver var resolver = MessagePack.Resolvers.CompositeResolver.Create( new[] { MessagePack.Formatters.TypelessFormatter.Instance }, new[] { MessagePack.Resolvers.StandardResolver.Instance }); public class Foo { // use Typeless(this field only) [MessagePackFormatter(typeof(TypelessFormatter))] public object Bar; }"><pre><span class="pl-c">// Replaced `object` uses the typeless resolver</span> <span class="pl-smi">var</span> <span class="pl-s1">resolver</span> <span class="pl-c1">=</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>CompositeResolver<span class="pl-kos">.</span><span class="pl-en">Create</span><span class="pl-kos">(</span> <span class="pl-k">new</span><span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-kos">{</span> MessagePack<span class="pl-kos">.</span>Formatters<span class="pl-kos">.</span>TypelessFormatter<span class="pl-kos">.</span>Instance <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">new</span><span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-kos">{</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>StandardResolver<span class="pl-kos">.</span>Instance <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span> <span class="pl-c">// use Typeless(this field only)</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackFormatter<span class="pl-kos">(</span><span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">TypelessFormatter</span><span class="pl-kos">)</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">object</span> <span class="pl-s1">Bar</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">If a type's name is changed later, you can no longer deserialize old blobs. But you can specify a fallback name in such cases, providing a <code>TypelessFormatter.BindToType</code> function of your own.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="MessagePack.Formatters.TypelessFormatter.BindToType = typeName =&gt; { if (typeName.StartsWith(&quot;SomeNamespace&quot;)) { typeName = typeName.Replace(&quot;SomeNamespace&quot;, &quot;AnotherNamespace&quot;); } return Type.GetType(typeName, false); };"><pre>MessagePack<span class="pl-kos">.</span>Formatters<span class="pl-kos">.</span>TypelessFormatter<span class="pl-kos">.</span>BindToType <span class="pl-c1">=</span> <span class="pl-s1">typeName <span class="pl-c1">=&gt;</span></span> <span class="pl-s1"><span class="pl-kos">{</span></span> <span class="pl-s1"> <span class="pl-k">if</span> <span class="pl-kos">(</span>typeName<span class="pl-kos">.</span><span class="pl-en">StartsWith</span><span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>SomeNamespace<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">)</span></span> <span class="pl-s1"> <span class="pl-kos">{</span></span> <span class="pl-s1"> <span class="pl-s1">typeName</span> <span class="pl-c1">=</span> typeName<span class="pl-kos">.</span><span class="pl-en">Replace</span><span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>SomeNamespace<span class="pl-s">"</span></span><span class="pl-kos">,</span> <span class="pl-s"><span class="pl-s">"</span>AnotherNamespace<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span></span> <span class="pl-s1"> <span class="pl-kos">}</span></span> <span class="pl-s1"></span> <span class="pl-s1"> <span class="pl-k">return</span> Type<span class="pl-kos">.</span><span class="pl-en">GetType</span><span class="pl-kos">(</span>typeName<span class="pl-kos">,</span> <span class="pl-c1">false</span><span class="pl-kos">)</span><span class="pl-kos">;</span></span> <span class="pl-s1"><span class="pl-kos">}</span></span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-security"></a>Security</h2><a id="user-content-security" class="anchor" aria-label="Permalink: Security" href="#security"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Deserializing data from an untrusted source can introduce security vulnerabilities in your application. Depending on the settings used during deserialization, <strong>untrusted data may be able to execute arbitrary code</strong> or cause a denial of service attack. Untrusted data might come from over the network from an untrusted source (e.g. any and every networked client) or can be tampered with by an intermediary when transmitted over an unauthenticated connection, or from a local storage that might have been tampered with, or many other sources. MessagePack for C# does not provide any means to authenticate data or make it tamper-resistant. Please use an appropriate method of authenticating data before deserialization - such as a <a href="https://en.wikipedia.org/wiki/Message_authentication_code" rel="nofollow"><code>MAC</code></a> .</p> <p dir="auto">Please be very mindful of these attack scenarios; many projects and companies, and serialization library users in general, have been bitten by untrusted user data deserialization in the past.</p> <p dir="auto">When deserializing untrusted data, put MessagePack into a more secure mode by configuring your <code>MessagePackSerializerOptions.Security</code> property:</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var options = MessagePackSerializerOptions.Standard .WithSecurity(MessagePackSecurity.UntrustedData); // Pass the options explicitly for the greatest control. T object = MessagePackSerializer.Deserialize&lt;T&gt;(data, options); // Or set the security level as the default. MessagePackSerializer.DefaultOptions = options;"><pre><span class="pl-smi">var</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> MessagePackSerializerOptions<span class="pl-kos">.</span>Standard <span class="pl-kos">.</span><span class="pl-en">WithSecurity</span><span class="pl-kos">(</span>MessagePackSecurity<span class="pl-kos">.</span>UntrustedData<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Pass the options explicitly for the greatest control.</span> <span class="pl-smi">T</span> <span class="pl-s1">object</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>data<span class="pl-kos">,</span> options<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Or set the security level as the default.</span> MessagePackSerializer<span class="pl-kos">.</span>DefaultOptions <span class="pl-c1">=</span> <span class="pl-s1">options</span><span class="pl-kos">;</span></pre></div> <p dir="auto">You should also avoid the Typeless serializer/formatters/resolvers for untrusted data as that opens the door for the untrusted data to potentially deserialize unanticipated types that can compromise security.</p> <p dir="auto">The <code>UntrustedData</code> mode merely hardens against some common attacks, but is no fully secure solution in itself.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Performance</h2><a id="user-content-performance" class="anchor" aria-label="Permalink: Performance" href="#performance"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Benchmarks comparing MessagePack For C# to other serializers were run on <code>Windows 10 Pro x64 Intel Core i7-6700K 4.00GHz, 32GB RAM</code>. Benchmark code is <a href="https://github.com/neuecc/ZeroFormatter/tree/master/sandbox/PerformanceComparison">available here</a> - and their <a href="https://github.com/neuecc/ZeroFormatter/blob/bc63cb925d/sandbox/PerformanceComparison/packages.config">version info</a>. <a href="https://github.com/neuecc/ZeroFormatter/">ZeroFormatter</a> and <a href="https://google.github.io/flatbuffers/" rel="nofollow">FlatBuffers</a> have infinitely fast deserializers, so ignore their deserialization performance.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/46207/23835765/55fe494e-07b0-11e7-98be-5e7a9411da40.png"><img src="https://cloud.githubusercontent.com/assets/46207/23835765/55fe494e-07b0-11e7-98be-5e7a9411da40.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">MessagePack for C# uses many techniques to improve performance.</p> <ul dir="auto"> <li>The serializer uses <code>IBufferWriter&lt;byte&gt;</code> rather than <code>System.IO.Stream</code> to reduce memory overhead.</li> <li>Buffers are rented from pools to reduce allocations, keeping throughput high through reduced GC pressure.</li> <li>Don't create intermediate utility instances (<code>*Writer/*Reader</code>, <code>*Context</code>, etc...)</li> <li>Utilize dynamic code generation and JIT to avoid boxing value types. Use AOT generation on platforms that prohibit JITs.</li> <li>Cached generated formatters on static generic fields (don't use dictionary-cache because dictionary lookup is overhead). See <a href="https://github.com/neuecc/MessagePack-CSharp/tree/209f301e2e595ed366408624011ba2e856d23429/src/MessagePack/Resolvers">Resolvers</a></li> <li>Heavily tuned dynamic IL code generation and JIT to avoid boxing value types. See <a href="https://github.com/neuecc/MessagePack-CSharp/blob/209f301e2e595ed366408624011ba2e856d23429/src/MessagePack/Resolvers/DynamicObjectResolver.cs#L142-L754">DynamicObjectTypeBuilder</a>. Use AOT generation on platforms that prohibit JIT.</li> <li>Call the Primitive API directly when IL code generation determines target types to be primitive.</li> <li>Reduce branching of variable length formats when IL code generation knows the target type (integer/string) ranges</li> <li>Don't use the <code>IEnumerable&lt;T&gt;</code> abstraction to iterate over collections when possible, <a href="https://github.com/neuecc/MessagePack-CSharp/blob/209f301e2e595ed366408624011ba2e856d23429/src/MessagePack/Formatters/CollectionFormatter.cs#L192-L355">see: CollectionFormatterBase</a> and derived collection formatters</li> <li>Use pre-generated lookup tables to reduce checks of mgpack type constraints, <a href="https://github.com/neuecc/MessagePack-CSharp/blob/209f301e2e595ed366408624011ba2e856d23429/src/MessagePack/MessagePackBinary.cs#L15-L212">see: MessagePackBinary</a></li> <li>Uses optimized type key dictionary for non-generic methods, <a href="https://github.com/neuecc/MessagePack-CSharp/blob/91312921cb7fe987f48336768c898a76ac7dbb40/src/MessagePack/Internal/ThreadsafeTypeKeyHashTable.cs">see: ThreadsafeTypeKeyHashTable</a></li> <li>Avoid string key decoding for lookup maps (string key and use automata based name lookup with inlined IL code generation, see: <a href="https://github.com/neuecc/MessagePack-CSharp/blob/bcedbce3fd98cb294210d6b4a22bdc4c75ccd916/src/MessagePack/Internal/AutomataDictionary.cs">AutomataDictionary</a></li> <li>To encode string keys, use pre-generated member name bytes and fixed sized byte array copies in IL, see: <a href="https://github.com/neuecc/MessagePack-CSharp/blob/f17ddc5d107d3a2f66f60398b214ef87919ff892/src/MessagePack/Internal/UnsafeMemory.cs">UnsafeMemory.cs</a></li> </ul> <p dir="auto">Before creating this library, I implemented a fast serializer with <a href="https://github.com/neuecc/ZeroFormatter#performance">ZeroFormatter#Performance</a>. This is a further evolved implementation. MessagePack for C# is always fast and optimized for all types (primitive, small struct, large object, any collections).</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-deserialize-performance"></a>Deserialization Performance for different options</h3><a id="user-content-deserialization-performance-for-different-options" class="anchor" aria-label="Permalink: Deserialization Performance for different options" href="#deserialization-performance-for-different-options"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Performance varies depending on the options used. This is a micro benchmark with <a href="https://github.com/dotnet/BenchmarkDotNet">BenchmarkDotNet</a>. The target object has 9 members (<code>MyProperty1</code> ~ <code>MyProperty9</code>), values are zero.</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Method</th> <th align="right">Mean</th> <th align="right">Error</th> <th align="right">Scaled</th> <th align="right">Gen 0</th> <th align="right">Allocated</th> </tr> </thead> <tbody> <tr> <td>M IntKey</td> <td align="right">72.67 ns</td> <td align="right">NA</td> <td align="right">1.00</td> <td align="right">0.0132</td> <td align="right">56 B</td> </tr> <tr> <td>M StringKey</td> <td align="right">217.95 ns</td> <td align="right">NA</td> <td align="right">3.00</td> <td align="right">0.0131</td> <td align="right">56 B</td> </tr> <tr> <td>M Typeless_IntKey</td> <td align="right">176.71 ns</td> <td align="right">NA</td> <td align="right">2.43</td> <td align="right">0.0131</td> <td align="right">56 B</td> </tr> <tr> <td>M Typeless_StringKey</td> <td align="right">378.64 ns</td> <td align="right">NA</td> <td align="right">5.21</td> <td align="right">0.0129</td> <td align="right">56 B</td> </tr> <tr> <td>MsgPackCliMap</td> <td align="right">1,355.26 ns</td> <td align="right">NA</td> <td align="right">18.65</td> <td align="right">0.1431</td> <td align="right">608 B</td> </tr> <tr> <td>MsgPackCliArray</td> <td align="right">455.28 ns</td> <td align="right">NA</td> <td align="right">6.26</td> <td align="right">0.0415</td> <td align="right">176 B</td> </tr> <tr> <td>ProtobufNet</td> <td align="right">265.85 ns</td> <td align="right">NA</td> <td align="right">3.66</td> <td align="right">0.0319</td> <td align="right">136 B</td> </tr> <tr> <td>Hyperion</td> <td align="right">366.47 ns</td> <td align="right">NA</td> <td align="right">5.04</td> <td align="right">0.0949</td> <td align="right">400 B</td> </tr> <tr> <td>JsonNetString</td> <td align="right">2,783.39 ns</td> <td align="right">NA</td> <td align="right">38.30</td> <td align="right">0.6790</td> <td align="right">2864 B</td> </tr> <tr> <td>JsonNetStreamReader</td> <td align="right">3,297.90 ns</td> <td align="right">NA</td> <td align="right">45.38</td> <td align="right">1.4267</td> <td align="right">6000 B</td> </tr> <tr> <td>JilString</td> <td align="right">553.65 ns</td> <td align="right">NA</td> <td align="right">7.62</td> <td align="right">0.0362</td> <td align="right">152 B</td> </tr> <tr> <td>JilStreamReader</td> <td align="right">1,408.46 ns</td> <td align="right">NA</td> <td align="right">19.38</td> <td align="right">0.8450</td> <td align="right">3552 B</td> </tr> </tbody> </table></markdown-accessiblity-table> <p dir="auto"><code>ÌntKey</code>, <code>StringKey</code>, <code>Typeless_IntKey</code>, <code>Typeless_StringKey</code> are MessagePack for C# options. All MessagePack for C# options achieve zero memory allocations in the deserialization process. <code>JsonNetString</code>/<code>JilString</code> is deserialized from strings. <code>JsonNetStreamReader</code>/<code>JilStreamReader</code> is deserialized from UTF-8 byte arrays using <code>StreamReader</code>. Deserialization is normally read from Stream. Thus, it will be restored from byte arrays (or Stream) instead of strings.</p> <p dir="auto">MessagePack for C# <code>IntKey</code> is the fastest. <code>StringKey</code> is slower than <code>IntKey</code> because matching the character string of property names is required. <code>IntKey</code> works by reading the array length, then <code>for (array length) { binary decode }</code>. <code>StringKey</code> works by reading map length, <code>for (map length) { decode key, lookup key, binary decode }</code>, so it requires an additional two steps (decoding of keys and lookups of keys).</p> <p dir="auto">String key is often a useful, contractless, simple replacement of JSON, interoperability with other languages, and more robust versioning. MessagePack for C# is also optimized for string keys as much a possible. First of all, it does not decode UTF-8 byte arrays to full string for matching with the member name; instead it will look up the byte arrays as it is (to avoid decoding costs and extra memory allocations).</p> <p dir="auto">And It will try to match each <code>long type</code> (per 8 character, if it is not enough, pad with 0) using <a href="https://en.wikipedia.org/wiki/Automata_theory" rel="nofollow">automata</a> and inline it when generating IL code.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/46207/29754771-216b40e2-8bc7-11e7-8310-1c3602e80a08.png"><img src="https://user-images.githubusercontent.com/46207/29754771-216b40e2-8bc7-11e7-8310-1c3602e80a08.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">This also avoids calculating the hash code of byte arrays, and the comparison can be made several times faster using the long type.</p> <p dir="auto">This is the sample of decompiled generated deserializer code, decompiled using <a href="http://ilspy.net/" rel="nofollow">ILSpy</a>.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/46207/29754804-b5ba0f44-8bc7-11e7-9f6b-0c8f3c041237.png"><img src="https://user-images.githubusercontent.com/46207/29754804-b5ba0f44-8bc7-11e7-9f6b-0c8f3c041237.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">If the number of nodes is large, searches will use an embedded binary search.</p> <p dir="auto">Extra note, this is serialization benchmark result.</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Method</th> <th align="right">Mean</th> <th align="right">Error</th> <th align="right">Scaled</th> <th align="right">Gen 0</th> <th align="right">Allocated</th> </tr> </thead> <tbody> <tr> <td>IntKey</td> <td align="right">84.11 ns</td> <td align="right">NA</td> <td align="right">1.00</td> <td align="right">0.0094</td> <td align="right">40 B</td> </tr> <tr> <td>StringKey</td> <td align="right">126.75 ns</td> <td align="right">NA</td> <td align="right">1.51</td> <td align="right">0.0341</td> <td align="right">144 B</td> </tr> <tr> <td>Typeless_IntKey</td> <td align="right">183.31 ns</td> <td align="right">NA</td> <td align="right">2.18</td> <td align="right">0.0265</td> <td align="right">112 B</td> </tr> <tr> <td>Typeless_StringKey</td> <td align="right">193.95 ns</td> <td align="right">NA</td> <td align="right">2.31</td> <td align="right">0.0513</td> <td align="right">216 B</td> </tr> <tr> <td>MsgPackCliMap</td> <td align="right">967.68 ns</td> <td align="right">NA</td> <td align="right">11.51</td> <td align="right">0.1297</td> <td align="right">552 B</td> </tr> <tr> <td>MsgPackCliArray</td> <td align="right">284.20 ns</td> <td align="right">NA</td> <td align="right">3.38</td> <td align="right">0.1006</td> <td align="right">424 B</td> </tr> <tr> <td>ProtobufNet</td> <td align="right">176.43 ns</td> <td align="right">NA</td> <td align="right">2.10</td> <td align="right">0.0665</td> <td align="right">280 B</td> </tr> <tr> <td>Hyperion</td> <td align="right">280.14 ns</td> <td align="right">NA</td> <td align="right">3.33</td> <td align="right">0.1674</td> <td align="right">704 B</td> </tr> <tr> <td>ZeroFormatter</td> <td align="right">149.95 ns</td> <td align="right">NA</td> <td align="right">1.78</td> <td align="right">0.1009</td> <td align="right">424 B</td> </tr> <tr> <td>JsonNetString</td> <td align="right">1,432.55 ns</td> <td align="right">NA</td> <td align="right">17.03</td> <td align="right">0.4616</td> <td align="right">1944 B</td> </tr> <tr> <td>JsonNetStreamWriter</td> <td align="right">1,775.72 ns</td> <td align="right">NA</td> <td align="right">21.11</td> <td align="right">1.5526</td> <td align="right">6522 B</td> </tr> <tr> <td>JilString</td> <td align="right">547.51 ns</td> <td align="right">NA</td> <td align="right">6.51</td> <td align="right">0.3481</td> <td align="right">1464 B</td> </tr> <tr> <td>JilStreamWriter</td> <td align="right">778.78 ns</td> <td align="right">NA</td> <td align="right">9.26</td> <td align="right">1.4448</td> <td align="right">6066 B</td> </tr> </tbody> </table></markdown-accessiblity-table> <p dir="auto">Of course, <code>IntKey</code> is fastest but <code>StringKey</code> also performs reasonably well.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-string-interning"></a>String interning</h3><a id="user-content-string-interning" class="anchor" aria-label="Permalink: String interning" href="#string-interning"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The msgpack format does not provide for reusing strings in the data stream. This naturally leads the deserializer to create a new <code>string</code> object for every string encountered, even if it is equal to another string previously encountered.</p> <p dir="auto">When deserializing data that may contain the same strings repeatedly it can be worthwhile to have the deserializer take a little extra time to check whether it has seen a given string before and reuse it if it has.</p> <p dir="auto">To enable string interning on <em>all</em> string values, use a resolver that specifies <code>StringInterningFormatter</code> before any of the standard ones, like this:</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var options = MessagePackSerializerOptions.Standard.WithResolver( CompositeResolver.Create( new IMessagePackFormatter[] { new StringInterningFormatter() }, new IFormatterResolver[] { StandardResolver.Instance })); MessagePackSerializer.Deserialize&lt;ClassOfStrings&gt;(data, options);"><pre><span class="pl-smi">var</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> MessagePackSerializerOptions<span class="pl-kos">.</span>Standard<span class="pl-kos">.</span><span class="pl-en">WithResolver</span><span class="pl-kos">(</span> CompositeResolver<span class="pl-kos">.</span><span class="pl-en">Create</span><span class="pl-kos">(</span> <span class="pl-k">new</span> IMessagePackFormatter<span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-kos">{</span> <span class="pl-k">new</span> StringInterningFormatter<span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">new</span> IFormatterResolver<span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-kos">{</span> StandardResolver<span class="pl-kos">.</span>Instance <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">ClassOfStrings</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>data<span class="pl-kos">,</span> options<span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">If you know which fields of a particular type are likely to contain duplicate strings, you can apply the string interning formatter to just those fields so the deserializer only pays for the interned string check where it matters most. Note that this technique requires a <code>[MessagePackObject]</code> or <code>[DataContract]</code> class.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackObject] public class ClassOfStrings { [Key(0)] [MessagePackFormatter(typeof(StringInterningFormatter))] public string InternedString { get; set; } [Key(1)] public string OrdinaryString { get; set; } }"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">ClassOfStrings</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackFormatter<span class="pl-kos">(</span><span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">StringInterningFormatter</span><span class="pl-kos">)</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">string</span> <span class="pl-s1">InternedString</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">string</span> <span class="pl-s1">OrdinaryString</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">If you are writing your own formatter for some type that contains strings, you can call on the <code>StringInterningFormatter</code> directly from your formatter as well for the strings.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">LZ4 Compression</h2><a id="user-content-lz4-compression" class="anchor" aria-label="Permalink: LZ4 Compression" href="#lz4-compression"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePack is a fast and <em>compact</em> format but it is not compression. <a href="https://github.com/lz4/lz4">LZ4</a> is an extremely fast compression algorithm, and using it MessagePack for C# can achieve extremely fast performance as well as extremely compact binary sizes!</p> <p dir="auto">MessagePack for C# has built-in LZ4 support. You can activate it using a modified options object and passing it into an API like this:</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var lz4Options = MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray); MessagePackSerializer.Serialize(obj, lz4Options);"><pre><span class="pl-smi">var</span> <span class="pl-s1">lz4Options</span> <span class="pl-c1">=</span> MessagePackSerializerOptions<span class="pl-kos">.</span>Standard<span class="pl-kos">.</span><span class="pl-en">WithCompression</span><span class="pl-kos">(</span>MessagePackCompression<span class="pl-kos">.</span>Lz4BlockArray<span class="pl-kos">)</span><span class="pl-kos">;</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>obj<span class="pl-kos">,</span> lz4Options<span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto"><code>MessagePackCompression</code> has two modes, <code>Lz4Block</code> and <code>Lz4BlockArray</code>. Neither is a simple binary LZ4 compression, but a special compression integrated into the serialization pipeline, using MessagePack <code>ext</code> code (<code>Lz4BlockArray (98)</code> or <code>Lz4Block (99)</code>). Therefore, it is not readily compatible with compression offered in other languages.</p> <p dir="auto"><code>Lz4Block</code> compresses an entire MessagePack sequence as a single LZ4 block. This is the simple compression that achieves best compression ratio, at the cost of copying the entire sequence when necessary to get contiguous memory.</p> <p dir="auto"><code>Lz4BlockArray</code> compresses an entire MessagePack sequence as a array of LZ4 blocks. Compressed/decompressed blocks are chunked and thus do not enter the GC's Large-Object-Heap, but the compression ratio is slightly worse.</p> <p dir="auto">We recommend to use <code>Lz4BlockArray</code> as the default when using compression. For compatibility with MessagePack v1.x, use <code>Lz4Block</code>.</p> <p dir="auto">Regardless of which LZ4 option is set at the deserialization, both methods can be deserialized. For example, when the <code>Lz4BlockArray</code> option was used, binary data using either <code>Lz4Block</code> and <code>Lz4BlockArray</code> can be deserialized. Neither can be decompressed and hence deserialized when the compression option is set to <code>None</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Attributions</h3><a id="user-content-attributions" class="anchor" aria-label="Permalink: Attributions" href="#attributions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">LZ4 compression support is using Milosz Krajewski's <a href="https://github.com/MiloszKrajewski/lz4net">lz4net</a> code with some modifications.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-comparison"></a>Comparison with protobuf, JSON, ZeroFormatter</h2><a id="user-content-comparison-with-protobuf-json-zeroformatter" class="anchor" aria-label="Permalink: Comparison with protobuf, JSON, ZeroFormatter" href="#comparison-with-protobuf-json-zeroformatter"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><a href="https://github.com/mgravell/protobuf-net">protobuf-net</a> is major, widely used binary-format library on .NET. I love protobuf-net and respect their great work. But when you use protobuf-net as a general purpose serialization format, you may encounter an annoying issue.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[ProtoContract] public class Parent { [ProtoMember(1)] public int Primitive { get; set; } [ProtoMember(2)] public Child Prop { get; set; } [ProtoMember(3)] public int[] Array { get; set; } } [ProtoContract] public class Child { [ProtoMember(1)] public int Number { get; set; } } using (var ms = new MemoryStream()) { // serialize null. ProtoBuf.Serializer.Serialize&lt;Parent&gt;(ms, null); ms.Position = 0; var result = ProtoBuf.Serializer.Deserialize&lt;Parent&gt;(ms); Console.WriteLine(result != null); // True, not null. but all property are zero formatted. Console.WriteLine(result.Primitive); // 0 Console.WriteLine(result.Prop); // null Console.WriteLine(result.Array); // null } using (var ms = new MemoryStream()) { // serialize empty array. ProtoBuf.Serializer.Serialize&lt;Parent&gt;(ms, new Parent { Array = System.Array.Empty&lt;int&gt;() }); ms.Position = 0; var result = ProtoBuf.Serializer.Deserialize&lt;Parent&gt;(ms); Console.WriteLine(result.Array == null); // True, null! }"><pre><span class="pl-kos">[</span><span class="pl-c1">ProtoContract</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Parent</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">ProtoMember<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Primitive</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">ProtoMember<span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">Child</span> <span class="pl-s1">Prop</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">ProtoMember<span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span><span class="pl-kos">[</span><span class="pl-kos">]</span> Array <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">ProtoContract</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Child</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">ProtoMember<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">Number</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> using <span class="pl-kos">(</span><span class="pl-smi">var</span> <span class="pl-s1">ms</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> MemoryStream<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// serialize null.</span> ProtoBuf<span class="pl-kos">.</span>Serializer<span class="pl-kos">.</span><span class="pl-smi">Serialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">Parent</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>ms<span class="pl-kos">,</span> null<span class="pl-kos">)</span><span class="pl-kos">;</span> ms<span class="pl-kos">.</span>Position<span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> ProtoBuf<span class="pl-kos">.</span>Serializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">Parent</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>ms<span class="pl-kos">)</span><span class="pl-kos">;</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>result <span class="pl-c1">!=</span> <span class="pl-c1">null</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// True, not null. but all property are zero formatted.</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>result<span class="pl-kos">.</span>Primitive<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// 0</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>result<span class="pl-kos">.</span>Prop<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// null</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>result<span class="pl-kos">.</span>Array<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// null</span> <span class="pl-kos">}</span> using <span class="pl-kos">(</span><span class="pl-smi">var</span> <span class="pl-s1">ms</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> MemoryStream<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// serialize empty array.</span> ProtoBuf<span class="pl-kos">.</span>Serializer<span class="pl-kos">.</span><span class="pl-smi">Serialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">Parent</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>ms<span class="pl-kos">,</span> new Parent <span class="pl-kos">{</span> Array <span class="pl-c1">=</span> System<span class="pl-kos">.</span>Array<span class="pl-kos">.</span>Empty<span class="pl-c1">&lt;</span><span class="pl-smi">int</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> ms<span class="pl-kos">.</span>Position<span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> ProtoBuf<span class="pl-kos">.</span>Serializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">Parent</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>ms<span class="pl-kos">)</span><span class="pl-kos">;</span> Console<span class="pl-kos">.</span>WriteLine<span class="pl-kos">(</span>result<span class="pl-kos">.</span>Array <span class="pl-c1">==</span> <span class="pl-c1">null</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// True, null!</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">protobuf(-net) cannot handle null and empty collection correctly, because protobuf has no <code>null</code> representation (see <a href="https://stackoverflow.com/questions/21631428/protobuf-net-deserializes-empty-collection-to-null-when-the-collection-is-a-prop/21632160#21632160" rel="nofollow">this SO answer from a protobuf-net author</a>).</p> <p dir="auto"><a href="https://github.com/msgpack/msgpack/blob/master/spec.md#type-system">MessagePack's type system</a> can correctly serialize the entire C# type system. This is a strong reason to recommend MessagePack over protobuf.</p> <p dir="auto">Protocol Buffers have good IDL and <a href="https://www.grpc.io/" rel="nofollow">gRPC</a> support. If you want to use IDL, I recommend <a href="https://github.com/google/protobuf/tree/master/csharp/src/Google.Protobuf">Google.Protobuf</a> over MessagePack.</p> <p dir="auto">JSON is good general-purpose format. It is simple, human-readable and thoroughly-enough specified. <a href="https://github.com/neuecc/Utf8Json">Utf8Json</a> - which I created as well - adopts same architecture as MessagePack for C# and avoids encoding/decoding costs as much as possible just like this library does. If you want to know more about binary vs text formats, see <a href="https://github.com/neuecc/Utf8Json#which-serializer-should-be-used">Utf8Json/which serializer should be used</a>.</p> <p dir="auto"><a href="https://github.com/neuecc/ZeroFormatter/">ZeroFormatter</a> is similar as <a href="https://google.github.io/flatbuffers/" rel="nofollow">FlatBuffers</a> but specialized to C#, and special in that regard. Deserialization is infinitely fast but the produced binary size is larger. And ZeroFormatter's caching algorithm requires additional memory.</p> <p dir="auto">For many common uses, MessagePack for C# would be a better fit.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Hints to achieve maximum performance when using MessagePack for C#</h2><a id="user-content-hints-to-achieve-maximum-performance-when-using-messagepack-for-c" class="anchor" aria-label="Permalink: Hints to achieve maximum performance when using MessagePack for C#" href="#hints-to-achieve-maximum-performance-when-using-messagepack-for-c"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePack for C# prioritizes maximum performance by default. However, there are also some options that sacrifice performance for convenience.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Use indexed keys instead of string keys (Contractless)</h3><a id="user-content-use-indexed-keys-instead-of-string-keys-contractless" class="anchor" aria-label="Permalink: Use indexed keys instead of string keys (Contractless)" href="#use-indexed-keys-instead-of-string-keys-contractless"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The <a href="https://github.com/neuecc/MessagePack-CSharp#deserialize-performance">Deserialization Performance for different options</a> section shows the results of indexed keys (<code>IntKey</code>) vs string keys (<code>StringKey</code>) performance. Indexed keys serialize the object graph as a MessagePack array. String keys serializes the object graph as a MessagePack map.</p> <p dir="auto">For example this type is serialized to</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackObject] public class Person { [Key(0)] or [Key(&quot;name&quot;)] public string Name { get; set;} [Key(1)] or [Key(&quot;age&quot;)] public int Age { get; set;} } new Person { Name = &quot;foobar&quot;, Age = 999 }"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Person</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> or <span class="pl-kos">[</span>Key<span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>name<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">]</span> public string Name <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span><span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> or <span class="pl-kos">[</span>Key<span class="pl-kos">(</span><span class="pl-s"><span class="pl-s">"</span>age<span class="pl-s">"</span></span><span class="pl-kos">)</span><span class="pl-kos">]</span> public int Age <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span><span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-k"><span class="pl-k">new</span></span> Person <span class="pl-kos">{</span> <span class="pl-s1">Name</span> <span class="pl-c1">=</span> <span class="pl-s"><span class="pl-s">"</span>foobar<span class="pl-s">"</span></span><span class="pl-kos">,</span> <span class="pl-s1">Age</span> <span class="pl-c1">=</span> <span class="pl-c1">999</span> <span class="pl-kos">}</span></pre></div> <ul dir="auto"> <li><code>IntKey</code>: <code>["foobar", 999]</code></li> <li><code>StringKey</code>: <code>{"name:"foobar","age":999}</code>.</li> </ul> <p dir="auto"><code>IntKey</code> is always fast in both serialization and deserialization because it does not have to handle and lookup key names, and always has the smaller binary size.</p> <p dir="auto"><code>StringKey</code> is often a useful, contractless, simple replacement for JSON, interoperability with other languages with MessagePack support, and less error prone versioning. But to achieve maximum performance, use <code>IntKey</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Create own custom composite resolver</h3><a id="user-content-create-own-custom-composite-resolver" class="anchor" aria-label="Permalink: Create own custom composite resolver" href="#create-own-custom-composite-resolver"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><code>CompositeResolver.Create</code> is an easy way to create composite resolvers. But formatter lookups have some overhead. If you create a custom resolver (or use <code>StaticCompositeResolver.Instance</code>), you can avoid this overhead.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class MyApplicationResolver : IFormatterResolver { public static readonly IFormatterResolver Instance = new MyApplicationResolver(); // configure your custom resolvers. private static readonly IFormatterResolver[] Resolvers = new IFormatterResolver[] { }; private MyApplicationResolver() { } public IMessagePackFormatter&lt;T&gt; GetFormatter&lt;T&gt;() { return Cache&lt;T&gt;.Formatter; } private static class Cache&lt;T&gt; { public static IMessagePackFormatter&lt;T&gt; Formatter; static Cache() { // configure your custom formatters. if (typeof(T) == typeof(XXX)) { Formatter = new ICustomFormatter(); return; } foreach (var resolver in Resolvers) { var f = resolver.GetFormatter&lt;T&gt;(); if (f != null) { Formatter = f; return; } } } } }"><pre><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MyApplicationResolver</span> <span class="pl-c1">:</span> <span class="pl-smi">IFormatterResolver</span> <span class="pl-kos">{</span> <span class="pl-k">public</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-k">readonly</span> <span class="pl-smi">IFormatterResolver</span> <span class="pl-s1">Instance</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> MyApplicationResolver<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// configure your custom resolvers.</span> <span class="pl-k">private</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-k">readonly</span> IFormatterResolver<span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-s1">Resolvers</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> IFormatterResolver<span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">private</span> <span class="pl-v">MyApplicationResolver</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> <span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-en">GetFormatter</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">Cache</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">.</span>Formatter<span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">private</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-k">class</span> <span class="pl-smi">Cache</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">public</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">Formatter</span><span class="pl-kos">;</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-v">Cache</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// configure your custom formatters.</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">T</span><span class="pl-kos">)</span> <span class="pl-c1">==</span> <span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">XXX</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">Formatter</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> ICustomFormatter<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">foreach</span> <span class="pl-kos">(</span><span class="pl-smi">var</span> resolver <span class="pl-k">in</span> Resolvers<span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">var</span> <span class="pl-s1">f</span> <span class="pl-c1">=</span> resolver<span class="pl-kos">.</span><span class="pl-smi">GetFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">f</span> <span class="pl-c1">!=</span> <span class="pl-c1">null</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">Formatter</span> <span class="pl-c1">=</span> <span class="pl-s1">f</span><span class="pl-kos">;</span> <span class="pl-k">return</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <blockquote> <p dir="auto">NOTE: If you are creating a library, recommend using the above custom resolver instead of <code>CompositeResolver.Create</code>. Also, libraries must not use <code>StaticCompositeResolver</code> - as it is global state - to avoid compatibility issues.</p> </blockquote> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Use native resolvers</h3><a id="user-content-use-native-resolvers" class="anchor" aria-label="Permalink: Use native resolvers" href="#use-native-resolvers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">By default, MessagePack for C# serializes GUID as string. This is much slower than the native .NET format GUID. The same applies to Decimal. If your application makes heavy use of GUID or Decimal and you don't have to worry about interoperability with other languages, you can replace them with the native serializers <code>NativeGuidResolver</code> and <code>NativeDecimalResolver</code> respectively.</p> <p dir="auto">Also, <code>DateTime</code> is serialized using the MessagePack timestamp format. By using the <code>NativeDateTimeResolver</code>, it is possible to maintain Kind and perform faster serialization.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Be careful when copying buffers</h3><a id="user-content-be-careful-when-copying-buffers" class="anchor" aria-label="Permalink: Be careful when copying buffers" href="#be-careful-when-copying-buffers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><code>MessagePackSerializer.Serialize</code> returns <code>byte[]</code> in default. The final <code>byte[]</code> is copied from an internal buffer pool. That is an extra cost. You can use <code>IBufferWriter&lt;T&gt;</code> or the <code>Stream</code> API to write to buffers directly. If you want to use a buffer pool outside of the serializer, you should implement custom <code>IBufferWriter&lt;byte&gt;</code> or use an existing one such as <a href="https://github.com/AArnott/Nerdbank.Streams/blob/master/doc/Sequence.md"><code>Sequence&lt;T&gt;</code></a> from the <a href="https://nuget.org/packages/Nerdbank.Streams" rel="nofollow">Nerdbank.Streams</a> package.</p> <p dir="auto">During deserialization, <code>MessagePackSerializer.Deserialize(ReadOnlyMemory&lt;byte&gt; buffer)</code> is better than the <code>Deserialize(Stream stream)</code> overload. This is because the Stream API version starts by reading the data, generating a <code>ReadOnlySequence&lt;byte&gt;</code>, and only then starts the deserialization.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Choosing compression</h3><a id="user-content-choosing-compression" class="anchor" aria-label="Permalink: Choosing compression" href="#choosing-compression"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Compression is generally effective when there is duplicate data. In MessagePack, arrays containing objects using string keys (Contractless) can be compressed efficiently because compression can be applied to many duplicate property names. Indexed keys compression is not as effectively compressed as string keys, but indexed keys are smaller in the first place.</p> <p dir="auto">This is some example benchmark performance data;</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Serializer</th> <th align="right">Mean</th> <th align="right">DataSize</th> </tr> </thead> <tbody> <tr> <td>IntKey</td> <td align="right">2.941 us</td> <td align="right">469.00 B</td> </tr> <tr> <td>IntKey(Lz4)</td> <td align="right">3.449 us</td> <td align="right">451.00 B</td> </tr> <tr> <td>StringKey</td> <td align="right">4.340 us</td> <td align="right">1023.00 B</td> </tr> <tr> <td>StringKey(Lz4)</td> <td align="right">5.469 us</td> <td align="right">868.00 B</td> </tr> </tbody> </table></markdown-accessiblity-table> <p dir="auto"><code>IntKey(Lz4)</code> is not as effectively compressed, but performance is still somewhat degraded. On the other hand, <code>StringKey</code> can be expected to have a sufficient effect on the binary size. However, this is just an example. Compression can be quite effective depending on the data, too, or have little effect other than slowing down your program. There are also cases in which well-compressible data exists in the values (such as long strings, e.g. containing HTML data with many repeated HTML tags). It is important to verify the actual effects of compression on a case by case basis.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Extensions</h2><a id="user-content-extensions" class="anchor" aria-label="Permalink: Extensions" href="#extensions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePack for C# has extension points that enable you to provide optimal serialization support for custom types. There are official extension support packages.</p> <div class="highlight highlight-source-powershell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Install-Package MessagePack.ReactiveProperty Install-Package MessagePack.UnityShims Install-Package MessagePack.AspNetCoreMvcFormatter"><pre><span class="pl-c1">Install-Package</span> MessagePack.ReactiveProperty <span class="pl-c1">Install-Package</span> MessagePack.UnityShims <span class="pl-c1">Install-Package</span> MessagePack.AspNetCoreMvcFormatter</pre></div> <p dir="auto">The <code>MessagePack.ReactiveProperty</code> package adds support for types of the <a href="https://github.com/runceel/ReactiveProperty">ReactiveProperty</a> library. It adds <code>ReactiveProperty&lt;&gt;</code>, <code>IReactiveProperty&lt;&gt;</code>, <code>IReadOnlyReactiveProperty&lt;&gt;</code>, <code>ReactiveCollection&lt;&gt;</code>, <code>Unit</code> serialization support. It is useful for save viewmodel state.</p> <p dir="auto">The <code>MessagePack.UnityShims</code> package provides shims for <a href="https://unity3d.com/" rel="nofollow">Unity</a>'s standard structs (<code>Vector2</code>, <code>Vector3</code>, <code>Vector4</code>, <code>Quaternion</code>, <code>Color</code>, <code>Bounds</code>, <code>Rect</code>, <code>AnimationCurve</code>, <code>Keyframe</code>, <code>Matrix4x4</code>, <code>Gradient</code>, <code>Color32</code>, <code>RectOffset</code>, <code>LayerMask</code>, <code>Vector2Int</code>, <code>Vector3Int</code>, <code>RangeInt</code>, <code>RectInt</code>, <code>BoundsInt</code>) and corresponding formatters. It can enable proper communication between servers and Unity clients.</p> <p dir="auto">After installation, extension packages must be enabled, by creating composite resolvers. Here is an example showing how to enable all extensions.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Set extensions to default resolver. var resolver = MessagePack.Resolvers.CompositeResolver.Create( // enable extension packages first ReactivePropertyResolver.Instance, MessagePack.Unity.Extension.UnityBlitResolver.Instance, MessagePack.Unity.UnityResolver.Instance, // finally use standard (default) resolver StandardResolver.Instance ); var options = MessagePackSerializerOptions.Standard.WithResolver(resolver); // Pass options every time or set as default MessagePackSerializer.DefaultOptions = options;"><pre><span class="pl-c">// Set extensions to default resolver.</span> <span class="pl-smi">var</span> <span class="pl-s1">resolver</span> <span class="pl-c1">=</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>CompositeResolver<span class="pl-kos">.</span><span class="pl-en">Create</span><span class="pl-kos">(</span> <span class="pl-c">// enable extension packages first</span> ReactivePropertyResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Unity<span class="pl-kos">.</span>Extension<span class="pl-kos">.</span>UnityBlitResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Unity<span class="pl-kos">.</span>UnityResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> <span class="pl-c">// finally use standard (default) resolver</span> StandardResolver<span class="pl-kos">.</span>Instance <span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> MessagePackSerializerOptions<span class="pl-kos">.</span>Standard<span class="pl-kos">.</span><span class="pl-en">WithResolver</span><span class="pl-kos">(</span>resolver<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Pass options every time or set as default</span> MessagePackSerializer<span class="pl-kos">.</span>DefaultOptions <span class="pl-c1">=</span> <span class="pl-s1">options</span><span class="pl-kos">;</span></pre></div> <p dir="auto">For configuration details, see: <a href="#resolvers">Extension Point section</a>.</p> <p dir="auto">The <code>MessagePack.AspNetCoreMvcFormatter</code> is add-on for <a href="https://github.com/aspnet/Mvc">ASP.NET Core MVC</a>'s serialization to boost up performance. This is configuration sample.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public void ConfigureServices(IServiceCollection services) { services.AddMvc().AddMvcOptions(option =&gt; { option.OutputFormatters.Clear(); option.OutputFormatters.Add(new MessagePackOutputFormatter(ContractlessStandardResolver.Options)); option.InputFormatters.Clear(); option.InputFormatters.Add(new MessagePackInputFormatter(ContractlessStandardResolver.Options)); }); }"><pre><span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">ConfigureServices</span><span class="pl-kos">(</span><span class="pl-smi">IServiceCollection</span> <span class="pl-s1">services</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> services<span class="pl-kos">.</span><span class="pl-en">AddMvc</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">AddMvcOptions</span><span class="pl-kos">(</span><span class="pl-s1">option <span class="pl-c1">=&gt;</span></span> <span class="pl-s1"> <span class="pl-kos">{</span></span> <span class="pl-s1"> option<span class="pl-kos">.</span>OutputFormatters<span class="pl-kos">.</span><span class="pl-en">Clear</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></span> <span class="pl-s1"> option<span class="pl-kos">.</span>OutputFormatters<span class="pl-kos">.</span><span class="pl-en">Add</span><span class="pl-kos">(</span><span class="pl-k">new</span> MessagePackOutputFormatter<span class="pl-kos">(</span>ContractlessStandardResolver<span class="pl-kos">.</span>Options<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></span> <span class="pl-s1"> option<span class="pl-kos">.</span>InputFormatters<span class="pl-kos">.</span><span class="pl-en">Clear</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></span> <span class="pl-s1"> option<span class="pl-kos">.</span>InputFormatters<span class="pl-kos">.</span><span class="pl-en">Add</span><span class="pl-kos">(</span><span class="pl-k">new</span> MessagePackInputFormatter<span class="pl-kos">(</span>ContractlessStandardResolver<span class="pl-kos">.</span>Options<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></span> <span class="pl-s1"> <span class="pl-kos">}</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">Other authors are creating extension packages, too.</p> <ul dir="auto"> <li><a href="https://github.com/Cysharp/MagicOnion">MagicOnion</a> - gRPC based HTTP/2 RPC Streaming Framework</li> <li><a href="https://github.com/Cysharp/MasterMemory">MasterMemory</a> - Embedded Readonly In-Memory Document Database</li> </ul> <p dir="auto">You can make your own extension serializers or integrate with frameworks. Let's create and share!</p> <ul dir="auto"> <li><a href="https://github.com/pocketberserker/MessagePack.FSharpExtensions">MessagePack.FSharpExtensions</a> - supports F# list, set, map, unit, option, discriminated union</li> <li><a href="https://github.com/ARKlab/MessagePack">MessagePack.NodaTime</a> - Support for NodaTime types to MessagePack C#</li> <li><a href="https://github.com/WebApiContrib/WebAPIContrib.Core#formatters">WebApiContrib.Core.Formatter.MessagePack</a> - supports ASP.NET Core MVC (<a href="https://www.strathweb.com/2017/06/using-messagepack-with-asp-net-core-mvc/" rel="nofollow">details in blog post</a>)</li> <li><a href="https://github.com/sketch7/MessagePack.MediaTypeFormatter">MessagePack.MediaTypeFormatter</a> - MessagePack MediaTypeFormatter</li> </ul> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Experimental Features</h2><a id="user-content-experimental-features" class="anchor" aria-label="Permalink: Experimental Features" href="#experimental-features"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePack for C# has experimental features which provides you with very performant formatters. There is an official package.</p> <div class="highlight highlight-source-powershell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Install-Package MessagePack.Experimental"><pre><span class="pl-c1">Install-Package</span> MessagePack.Experimental</pre></div> <p dir="auto">For detailed information, see: <a href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/src/MessagePack.Experimental/Experimental.md">Experimental.md</a></p> <div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">API</h1><a id="user-content-api" class="anchor" aria-label="Permalink: API" href="#api"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">High-Level API (<code>MessagePackSerializer</code>)</h2><a id="user-content-high-level-api-messagepackserializer" class="anchor" aria-label="Permalink: High-Level API (MessagePackSerializer)" href="#high-level-api-messagepackserializer"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The <code>MessagePackSerializer</code> class is the entry point of MessagePack for C#. Static methods make up the main API of MessagePack for C#.</p> <markdown-accessiblity-table><table> <thead> <tr> <th>API</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>Serialize&lt;T&gt;</code></td> <td>Serializes an object graph to a MessagePack binary blob. Async variant for Stream available. Non-generic overloads available.</td> </tr> <tr> <td><code>Deserialize&lt;T&gt;</code></td> <td>Deserializes a MessagePack binary to an object graph. Async variant for Stream available. Non-generic overloads available.</td> </tr> <tr> <td><code>SerializeToJson</code></td> <td>Serialize a MessagePack-compatible object graph to JSON instead of MessagePack. Useful for debugging.</td> </tr> <tr> <td><code>ConvertToJson</code></td> <td>Convert MessagePack binary to JSON. Useful for debugging.</td> </tr> <tr> <td><code>ConvertFromJson</code></td> <td>Convert JSON to a MessagePack binary.</td> </tr> </tbody> </table></markdown-accessiblity-table> <p dir="auto">The <code>MessagePackSerializer.Typeless</code> class offers most of the same APIs as above, but removes all type arguments from the API, forcing serialization to include the full type name of the root object. It uses the <code>TypelessContractlessStandardResolver</code>. Consider the result to be a .NET-specific MessagePack binary that isn't readily compatible with MessagePack deserializers in other runtimes.</p> <p dir="auto">MessagePack for C# fundamentally serializes using <code>IBufferWriter&lt;byte&gt;</code> and deserializes using <code>ReadOnlySequence&lt;byte&gt;</code> or <code>Memory&lt;byte&gt;</code>. Method overloads are provided to conveniently use it with common buffer types and the .NET <code>Stream</code> class, but some of these convenience overloads require copying buffers once and therefore have a certain overhead.</p> <p dir="auto">The high-level API uses a memory pool internally to avoid unnecessary memory allocation. If result size is under 64K, it allocates GC memory only for the return bytes.</p> <p dir="auto">Each serialize/deserialize method takes an optional <code>MessagePackSerializerOptions</code> parameter which can be used to specify a custom <code>IFormatterResolver</code> to use or to activate LZ4 compression support.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Multiple MessagePack structures on a single <code>Stream</code></h3><a id="user-content-multiple-messagepack-structures-on-a-single-stream" class="anchor" aria-label="Permalink: Multiple MessagePack structures on a single Stream" href="#multiple-messagepack-structures-on-a-single-stream"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">To deserialize a <code>Stream</code> that contains multiple consecutive MessagePack data structures, you can use the <code>MessagePackStreamReader</code> class to efficiently identify the <code>ReadOnlySequence&lt;byte&gt;</code> for each data structure and deserialize it. For example:</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="static async Task&lt;List&lt;T&gt;&gt; DeserializeListFromStreamAsync&lt;T&gt;(Stream stream, CancellationToken cancellationToken) { var dataStructures = new List&lt;T&gt;(); using (var streamReader = new MessagePackStreamReader(stream)) { while (await streamReader.ReadAsync(cancellationToken) is ReadOnlySequence&lt;byte&gt; msgpack) { dataStructures.Add(MessagePackSerializer.Deserialize&lt;T&gt;(msgpack, cancellationToken: cancellationToken)); } } return dataStructures; }"><pre><span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-k">async</span> <span class="pl-smi">Task</span><span class="pl-c1">&lt;</span><span class="pl-smi">List</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">DeserializeListFromStreamAsync</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-smi">Stream</span> <span class="pl-s1">stream</span><span class="pl-kos">,</span> <span class="pl-smi">CancellationToken</span> <span class="pl-s1">cancellationToken</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">var</span> <span class="pl-s1">dataStructures</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">List</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">using</span> <span class="pl-kos">(</span><span class="pl-smi">var</span> <span class="pl-s1">streamReader</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> MessagePackStreamReader<span class="pl-kos">(</span>stream<span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-k">await</span> streamReader<span class="pl-kos">.</span><span class="pl-en">ReadAsync</span><span class="pl-kos">(</span>cancellationToken<span class="pl-kos">)</span> <span class="pl-k">is</span> <span class="pl-smi">ReadOnlySequence</span><span class="pl-c1">&lt;</span><span class="pl-smi">byte</span><span class="pl-c1">&gt;</span> msgpack<span class="pl-kos">)</span> <span class="pl-kos">{</span> dataStructures<span class="pl-kos">.</span><span class="pl-en">Add</span><span class="pl-kos">(</span>MessagePackSerializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>msgpack<span class="pl-kos">,</span> cancellationToken<span class="pl-c1">:</span> cancellationToken<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-k">return</span> <span class="pl-s1">dataStructures</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Low-Level API (<code>IMessagePackFormatter&lt;T&gt;</code>)</h2><a id="user-content-low-level-api-imessagepackformattert" class="anchor" aria-label="Permalink: Low-Level API (IMessagePackFormatter&lt;T&gt;)" href="#low-level-api-imessagepackformattert"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The <code>IMessagePackFormatter&lt;T&gt;</code> interface is responsible for serializing a unique type. For example <code>Int32Formatter : IMessagePackFormatter&lt;Int32&gt;</code> represents Int32 MessagePack serializer.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public interface IMessagePackFormatter&lt;T&gt; { void Serialize(ref MessagePackWriter writer, T value, MessagePackSerializerOptions options); T Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options); }"><pre><span class="pl-k">public</span> <span class="pl-k">interface</span> <span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-smi">void</span> <span class="pl-en">Serialize</span><span class="pl-kos">(</span><span class="pl-k">ref</span> <span class="pl-smi">MessagePackWriter</span> <span class="pl-s1">writer</span><span class="pl-kos">,</span> <span class="pl-smi">T</span> <span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span> T <span class="pl-en">Deserialize</span><span class="pl-kos">(</span><span class="pl-k">ref</span> <span class="pl-smi">MessagePackReader</span> <span class="pl-s1">reader</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">Many built-in formatters exists under <code>MessagePack.Formatters</code>. Your custom types are usually automatically supported with the built-in type resolvers that generate new <code>IMessagePackFormatter&lt;T&gt;</code> types on-the-fly using dynamic code generation. See our <a href="#aot">AOT code generation</a> support for platforms that do not support this.</p> <p dir="auto">However, some types - especially those provided by third party libraries or the runtime itself - cannot be appropriately annotated, and contractless serialization would produce inefficient or even wrong results. To take more control over the serialization of such custom types, write your own <code>IMessagePackFormatter&lt;T&gt;</code> implementation. Here is an example of such a custom formatter implementation. Note its use of the primitive API that is described in the next section.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/// &lt;summary&gt;Serializes a &lt;see cref=&quot;FileInfo&quot; /&gt; by its full path as a string.&lt;/summary&gt; public class FileInfoFormatter : IMessagePackFormatter&lt;FileInfo&gt; { public void Serialize( ref MessagePackWriter writer, FileInfo value, MessagePackSerializerOptions options) { if (value == null) { writer.WriteNil(); return; } writer.WriteString(value.FullName); } public FileInfo Deserialize( ref MessagePackReader reader, MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return null; } options.Security.DepthStep(ref reader); var path = reader.ReadString(); reader.Depth--; return new FileInfo(path); } }"><pre><span class="pl-c">/// &lt;summary&gt;Serializes a &lt;see cref="FileInfo" /&gt; by its full path as a string.&lt;/summary&gt;</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">FileInfoFormatter</span> <span class="pl-c1">:</span> <span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">FileInfo</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">Serialize</span><span class="pl-kos">(</span> <span class="pl-k">ref</span> <span class="pl-smi">MessagePackWriter</span> <span class="pl-s1">writer</span><span class="pl-kos">,</span> <span class="pl-smi">FileInfo</span> <span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">value</span> <span class="pl-c1">==</span> <span class="pl-c1">null</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> writer<span class="pl-kos">.</span><span class="pl-en">WriteNil</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> writer<span class="pl-kos">.</span><span class="pl-en">WriteString</span><span class="pl-kos">(</span>value<span class="pl-kos">.</span>FullName<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> FileInfo <span class="pl-en">Deserialize</span><span class="pl-kos">(</span> <span class="pl-k">ref</span> <span class="pl-smi">MessagePackReader</span> <span class="pl-s1">reader</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span>reader<span class="pl-kos">.</span><span class="pl-en">TryReadNil</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-c1">null</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> options<span class="pl-kos">.</span>Security<span class="pl-kos">.</span><span class="pl-en">DepthStep</span><span class="pl-kos">(</span><span class="pl-k">ref</span> reader<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> reader<span class="pl-kos">.</span><span class="pl-en">ReadString</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> reader<span class="pl-kos">.</span>Depth<span class="pl-c1">--</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-k">new</span> FileInfo<span class="pl-kos">(</span>path<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">The <code>DepthStep</code> and <code>Depth--</code> statements provide a level of security while deserializing untrusted data that might otherwise be able to execute a denial of service attack by sending MessagePack data that would deserialize into a very deep object graph leading to a <code>StackOverflowException</code> that would crash the process. This pair of statements should surround the bulk of any <code>IMessagePackFormatter&lt;T&gt;.Deserialize</code> method.</p> <p dir="auto"><strong>Important</strong>: A message pack formatter must <em>read or write exactly one data structure</em>. In the above example we just read/write a string. If you have more than one element to write out, you must precede it with a map or array header. You must read the entire map/array when deserializing. For example:</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class MySpecialObjectFormatter : IMessagePackFormatter&lt;MySpecialObject&gt; { public void Serialize( ref MessagePackWriter writer, MySpecialObject value, MessagePackSerializerOptions options) { if (value == null) { writer.WriteNil(); return; } writer.WriteArrayHeader(2); writer.WriteString(value.FullName); writer.WriteString(value.Age); } public MySpecialObject Deserialize( ref MessagePackReader reader, MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return null; } options.Security.DepthStep(ref reader); string fullName = null; int age = 0; // Loop over *all* array elements independently of how many we expect, // since if we're serializing an older/newer version of this object it might // vary in number of elements that were serialized, but the contract of the formatter // is that exactly one data structure must be read, regardless. // Alternatively, we could check that the size of the array/map is what we expect // and throw if it is not. int count = reader.ReadArrayHeader(); for (int i = 0; i &lt; count; i++) { switch (i) { case 0: fullName = reader.ReadString(); break; case 1: age = reader.ReadInt32(); break; default: reader.Skip(); break; } } reader.Depth--; return new MySpecialObject(fullName, age); } }"><pre><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MySpecialObjectFormatter</span> <span class="pl-c1">:</span> <span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">MySpecialObject</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">Serialize</span><span class="pl-kos">(</span> <span class="pl-k">ref</span> <span class="pl-smi">MessagePackWriter</span> <span class="pl-s1">writer</span><span class="pl-kos">,</span> <span class="pl-smi">MySpecialObject</span> <span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">value</span> <span class="pl-c1">==</span> <span class="pl-c1">null</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> writer<span class="pl-kos">.</span><span class="pl-en">WriteNil</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> writer<span class="pl-kos">.</span><span class="pl-en">WriteArrayHeader</span><span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span> writer<span class="pl-kos">.</span><span class="pl-en">WriteString</span><span class="pl-kos">(</span>value<span class="pl-kos">.</span>FullName<span class="pl-kos">)</span><span class="pl-kos">;</span> writer<span class="pl-kos">.</span><span class="pl-en">WriteString</span><span class="pl-kos">(</span>value<span class="pl-kos">.</span>Age<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> MySpecialObject <span class="pl-en">Deserialize</span><span class="pl-kos">(</span> <span class="pl-k">ref</span> <span class="pl-smi">MessagePackReader</span> <span class="pl-s1">reader</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span>reader<span class="pl-kos">.</span><span class="pl-en">TryReadNil</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-c1">null</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> options<span class="pl-kos">.</span>Security<span class="pl-kos">.</span><span class="pl-en">DepthStep</span><span class="pl-kos">(</span><span class="pl-k">ref</span> reader<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">string</span> <span class="pl-s1">fullName</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span><span class="pl-kos">;</span> <span class="pl-smi">int</span> <span class="pl-s1">age</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-c">// Loop over *all* array elements independently of how many we expect,</span> <span class="pl-c">// since if we're serializing an older/newer version of this object it might</span> <span class="pl-c">// vary in number of elements that were serialized, but the contract of the formatter</span> <span class="pl-c">// is that exactly one data structure must be read, regardless.</span> <span class="pl-c">// Alternatively, we could check that the size of the array/map is what we expect</span> <span class="pl-c">// and throw if it is not.</span> <span class="pl-smi">int</span> <span class="pl-s1">count</span> <span class="pl-c1">=</span> reader<span class="pl-kos">.</span><span class="pl-en">ReadArrayHeader</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-smi">int</span> <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">count</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">case</span> <span class="pl-c1">0</span><span class="pl-c1">:</span> <span class="pl-s1">fullName</span> <span class="pl-c1">=</span> reader<span class="pl-kos">.</span><span class="pl-en">ReadString</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">break</span><span class="pl-kos">;</span> <span class="pl-k">case</span> <span class="pl-c1">1</span><span class="pl-c1">:</span> <span class="pl-s1">age</span> <span class="pl-c1">=</span> reader<span class="pl-kos">.</span><span class="pl-en">ReadInt32</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">break</span><span class="pl-kos">;</span> <span class="pl-k">default</span><span class="pl-c1">:</span> reader<span class="pl-kos">.</span><span class="pl-en">Skip</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">break</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> reader<span class="pl-kos">.</span>Depth<span class="pl-c1">--</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-k">new</span> MySpecialObject<span class="pl-kos">(</span>fullName<span class="pl-kos">,</span> age<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">Your custom formatters must be discoverable via some <code>IFormatterResolver</code>. Learn more in our <a href="#resolvers">resolvers</a> section.</p> <p dir="auto">You can see many other samples from <a href="https://github.com/neuecc/MessagePack-CSharp/tree/master/src/MessagePack/Formatters">builtin formatters</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Primitive API (<code>MessagePackWriter</code>, <code>MessagePackReader</code>)</h2><a id="user-content-primitive-api-messagepackwriter-messagepackreader" class="anchor" aria-label="Permalink: Primitive API (MessagePackWriter, MessagePackReader)" href="#primitive-api-messagepackwriter-messagepackreader"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The <code>MessagePackWriter</code> and <code>MessagePackReader</code> structs make up the lowest-level API. They read and write the primitives types defined in the MessagePack specification.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><code>MessagePackReader</code></h3><a id="user-content-messagepackreader" class="anchor" aria-label="Permalink: MessagePackReader" href="#messagepackreader"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A <code>MessagePackReader</code> can efficiently read from <code>ReadOnlyMemory&lt;byte&gt;</code> or <code>ReadOnlySequence&lt;byte&gt;</code> without any allocations, except to allocate a new <code>string</code> as required by the <code>ReadString()</code> method. All other methods return either value structs or <code>ReadOnlySequence&lt;byte&gt;</code> slices for extensions/arrays. Reading directly from <code>ReadOnlySequence&lt;byte&gt;</code> means the reader can directly consume some modern high performance APIs such as <code>PipeReader</code>.</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>Skip</code></td> <td>Advances the reader's position past the current value. If the value is complex (e.g. map, array) the entire structure is skipped.</td> </tr> <tr> <td><code>Read*</code></td> <td>Read and return a value whose type is named by the method name from the current reader position. Throws if the expected type does not match the actual type. When reading numbers, the type need not match the binary-specified type exactly. The numeric value will be coerced into the desired type or throw if the integer type is too small for a large value.</td> </tr> <tr> <td><code>TryReadNil</code></td> <td>Advances beyond the current value if the current value is <code>nil</code> and returns <code>true</code>; otherwise leaves the reader's position unchanged and returns <code>false</code>.</td> </tr> <tr> <td><code>ReadBytes</code></td> <td>Returns a slice of the input sequence representing the contents of a <code>byte[]</code>, and advances the reader.</td> </tr> <tr> <td><code>ReadStringSequence</code></td> <td>Returns a slice of the input sequence representing the contents of a <code>string</code> without decoding it, and advances the reader.</td> </tr> <tr> <td><code>Clone</code></td> <td>Creates a new <code>MessagePackReader</code> with the specified input sequence and the same settings as the original reader.</td> </tr> <tr> <td><code>CreatePeekReader</code></td> <td>Creates a new reader with the same position as this one, allowing the caller to "read ahead" without impacting the original reader's position.</td> </tr> <tr> <td><code>NextCode</code></td> <td>Reads the low-level MessagePack <code>byte</code> that describes the type of the next value. Does not advance the reader. See <a href="https://github.com/msgpack/msgpack/blob/master/spec.md#overview">MessagePack format of first byte</a>. Its static class has <code>ToMessagePackType</code> and <code>ToFormatName</code> utility methods. <code>MessagePackRange</code> means Min-Max fix range of MessagePack format.</td> </tr> <tr> <td><code>NextMessagePackType</code></td> <td>Describes the <code>NextCode</code> value as a higher level category. Does not advance the reader. See <a href="https://github.com/msgpack/msgpack/blob/master/spec.md#serialization-type-to-format-conversion">MessagePack spec of source types</a>.</td> </tr> <tr> <td>(others)</td> <td>Other methods and properties as described by the .xml doc comment file and Intellisense.</td> </tr> </tbody> </table></markdown-accessiblity-table> <p dir="auto">The <code>MessagePackReader</code> is capable of automatically interpreting both the old and new MessagePack spec.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><code>MessagePackWriter</code></h3><a id="user-content-messagepackwriter" class="anchor" aria-label="Permalink: MessagePackWriter" href="#messagepackwriter"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A <code>MessagePackWriter</code> writes to a given instance of <code>IBufferWriter&lt;byte&gt;</code>. Several common implementations of this exist, allowing zero allocations and minimal buffer copies while writing directly to several I/O APIs including <code>PipeWriter</code>.</p> <p dir="auto">The <code>MessagePackWriter</code> writes the new MessagePack spec by default, but can write MessagePack compatible with the old spec by setting the <code>OldSpec</code> property to <code>true</code>.</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>Clone</code></td> <td>Creates a new <code>MessagePackWriter</code> with the specified underlying <code>IBufferWriter&lt;byte&gt;</code> and the same settings as the original writer.</td> </tr> <tr> <td><code>Flush</code></td> <td>Writes any buffered bytes to the underlying <code>IBufferWriter&lt;byte&gt;</code>.</td> </tr> <tr> <td><code>WriteNil</code></td> <td>Writes the MessagePack equivalent of .NET's <code>null</code> value.</td> </tr> <tr> <td><code>Write</code></td> <td>Writes any MessagePack primitive value in the most compact form possible. Has overloads for every primitive type defined by the MessagePack spec.</td> </tr> <tr> <td><code>Write*IntType*</code></td> <td>Writes an integer value in exactly the MessagePack type specified, even if a more compact format exists.</td> </tr> <tr> <td><code>WriteMapHeader</code></td> <td>Introduces a map by specifying the number of key=value pairs it contains.</td> </tr> <tr> <td><code>WriteArrayHeader</code></td> <td>Introduces an array by specifying the number of elements it contains.</td> </tr> <tr> <td><code>WriteExtensionFormat</code></td> <td>Writes the full content of an extension value including length, type code and content.</td> </tr> <tr> <td><code>WriteExtensionFormatHeader</code></td> <td>Writes just the header (length and type code) of an extension value.</td> </tr> <tr> <td><code>WriteRaw</code></td> <td>Copies the specified bytes directly to the underlying <code>IBufferWriter&lt;byte&gt;</code> without any validation.</td> </tr> <tr> <td>(others)</td> <td>Other methods and properties as described by the .xml doc comment file and Intellisense.</td> </tr> </tbody> </table></markdown-accessiblity-table> <p dir="auto"><code>DateTime</code> is serialized to <a href="https://github.com/msgpack/msgpack/blob/master/spec.md#formats-timestamp">MessagePack Timestamp format</a>, it serialize/deserialize UTC and loses <code>Kind</code> info and requires that <code>MessagePackWriter.OldSpec == false</code>. If you use the <code>NativeDateTimeResolver</code>, <code>DateTime</code> values will be serialized using .NET's native <code>Int64</code> representation, which preserves <code>Kind</code> info but may not be interoperable with non-.NET platforms.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-resolvers"></a>Main Extension Point (<code>IFormatterResolver</code>)</h2><a id="user-content-main-extension-point-iformatterresolver" class="anchor" aria-label="Permalink: Main Extension Point (IFormatterResolver)" href="#main-extension-point-iformatterresolver"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">An <code>IFormatterResolver</code> is storage of typed serializers. The <code>MessagePackSerializer</code> API accepts a <code>MessagePackSerializerOptions</code> object which specifies the <code>IFormatterResolver</code> to use, allowing customization of the serialization of complex types.</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Resolver Name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>BuiltinResolver</td> <td>Builtin primitive and standard classes resolver. It includes primitive(int, bool, string...) and there nullable, array and list. and some extra builtin types(<code>Guid</code>, <code>Uri</code>, <code>BigInteger</code>, etc...).</td> </tr> <tr> <td>StandardResolver</td> <td>Composited resolver. It resolves in the following order <code>builtin -&gt; attribute -&gt; dynamic enum -&gt; dynamic generic -&gt; dynamic union -&gt; dynamic object -&gt; dynamic object fallback</code>. This is the default of MessagePackSerializer.</td> </tr> <tr> <td>ContractlessStandardResolver</td> <td>Composited <code>StandardResolver</code>(except dynamic object fallback) -&gt; <code>DynamicContractlessObjectResolver</code> -&gt; <code>DynamicObjectTypeFallbackResolver</code>. It enables contractless serialization.</td> </tr> <tr> <td>StandardResolverAllowPrivate</td> <td>Same as StandardResolver but allow serialize/deserialize private members.</td> </tr> <tr> <td>ContractlessStandardResolverAllowPrivate</td> <td>Same as ContractlessStandardResolver but allow serialize/deserialize private members.</td> </tr> <tr> <td>PrimitiveObjectResolver</td> <td>MessagePack primitive object resolver. It is used fallback in <code>object</code> type and supports <code>bool</code>, <code>char</code>, <code>sbyte</code>, <code>byte</code>, <code>short</code>, <code>int</code>, <code>long</code>, <code>ushort</code>, <code>uint</code>, <code>ulong</code>, <code>float</code>, <code>double</code>, <code>DateTime</code>, <code>string</code>, <code>byte[]</code>, <code>ICollection</code>, <code>IDictionary</code>.</td> </tr> <tr> <td>DynamicObjectTypeFallbackResolver</td> <td>Serialize is used type in from <code>object</code> type, deserialize is used PrimitiveObjectResolver.</td> </tr> <tr> <td>AttributeFormatterResolver</td> <td>Get formatter from <code>[MessagePackFormatter]</code> attribute.</td> </tr> <tr> <td>CompositeResolver</td> <td>Composes several resolvers and/or formatters together in an ordered list, allowing reuse and overriding of behaviors of existing resolvers and formatters.</td> </tr> <tr> <td>NativeDateTimeResolver</td> <td>Serialize by .NET native DateTime binary format. It keeps <code>DateTime.Kind</code> that loses by standard(MessagePack timestamp) format.</td> </tr> <tr> <td>NativeGuidResolver</td> <td>Serialize by .NET native Guid binary representation. It is faster than standard(string) representation.</td> </tr> <tr> <td>NativeDecimalResolver</td> <td>Serialize by .NET native decimal binary representation. It is faster than standard(string) representation.</td> </tr> <tr> <td>DynamicEnumResolver</td> <td>Resolver of enum and there nullable, serialize there underlying type. It uses dynamic code generation to avoid boxing and boostup performance serialize there name.</td> </tr> <tr> <td>DynamicEnumAsStringResolver</td> <td>Resolver of enum and there nullable. It uses reflection call for resolve nullable at first time.</td> </tr> <tr> <td>DynamicGenericResolver</td> <td>Resolver of generic type(<code>Tuple&lt;&gt;</code>, <code>List&lt;&gt;</code>, <code>Dictionary&lt;,&gt;</code>, <code>Array</code>, etc). It uses reflection call for resolve generic argument at first time.</td> </tr> <tr> <td>DynamicUnionResolver</td> <td>Resolver of interface marked by UnionAttribute. It uses dynamic code generation to create dynamic formatter.</td> </tr> <tr> <td>DynamicObjectResolver</td> <td>Resolver of class and struct made by MessagePackObjectAttribute. It uses dynamic code generation to create dynamic formatter.</td> </tr> <tr> <td>DynamicContractlessObjectResolver</td> <td>Resolver of all classes and structs. It does not needs <code>MessagePackObjectAttribute</code> and serialized key as string(same as marked <code>[MessagePackObject(true)]</code>).</td> </tr> <tr> <td>DynamicObjectResolverAllowPrivate</td> <td>Same as DynamicObjectResolver but allow serialize/deserialize private members.</td> </tr> <tr> <td>DynamicContractlessObjectResolverAllowPrivate</td> <td>Same as DynamicContractlessObjectResolver but allow serialize/deserialize private members.</td> </tr> <tr> <td>TypelessObjectResolver</td> <td>Used for <code>object</code>, embed .NET type in binary by <code>ext(100)</code> format so no need to pass type in deserialization.</td> </tr> <tr> <td>TypelessContractlessStandardResolver</td> <td>Composited resolver. It resolves in the following order <code>nativedatetime -&gt; builtin -&gt; attribute -&gt; dynamic enum -&gt; dynamic generic -&gt; dynamic union -&gt; dynamic object -&gt; dynamiccontractless -&gt; typeless</code>. This is the default of <code>MessagePackSerializer.Typeless</code></td> </tr> </tbody> </table></markdown-accessiblity-table> <p dir="auto">Each instance of <code>MessagePackSerializer</code> accepts only a single resolver. Most object graphs will need more than one for serialization, so composing a single resolver made up of several is often required, and can be done with the <code>CompositeResolver</code> as shown below:</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Do this once and store it for reuse. var resolver = MessagePack.Resolvers.CompositeResolver.Create( // resolver custom types first ReactivePropertyResolver.Instance, MessagePack.Unity.Extension.UnityBlitResolver.Instance, MessagePack.Unity.UnityResolver.Instance, // finally use standard resolver StandardResolver.Instance ); var options = MessagePackSerializerOptions.Standard.WithResolver(resolver); // Each time you serialize/deserialize, specify the options: byte[] msgpackBytes = MessagePackSerializer.Serialize(myObject, options); T myObject2 = MessagePackSerializer.Deserialize&lt;MyObject&gt;(msgpackBytes, options);"><pre><span class="pl-c">// Do this once and store it for reuse.</span> <span class="pl-smi">var</span> <span class="pl-s1">resolver</span> <span class="pl-c1">=</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>CompositeResolver<span class="pl-kos">.</span><span class="pl-en">Create</span><span class="pl-kos">(</span> <span class="pl-c">// resolver custom types first</span> ReactivePropertyResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Unity<span class="pl-kos">.</span>Extension<span class="pl-kos">.</span>UnityBlitResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Unity<span class="pl-kos">.</span>UnityResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> <span class="pl-c">// finally use standard resolver</span> StandardResolver<span class="pl-kos">.</span>Instance <span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> MessagePackSerializerOptions<span class="pl-kos">.</span>Standard<span class="pl-kos">.</span><span class="pl-en">WithResolver</span><span class="pl-kos">(</span>resolver<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Each time you serialize/deserialize, specify the options:</span> <span class="pl-smi">byte</span><span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-s1">msgpackBytes</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span>myObject<span class="pl-kos">,</span> options<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">T</span> <span class="pl-s1">myObject2</span> <span class="pl-c1">=</span> MessagePackSerializer<span class="pl-kos">.</span><span class="pl-smi">Deserialize</span><span class="pl-c1">&lt;</span><span class="pl-smi">MyObject</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span>msgpackBytes<span class="pl-kos">,</span> options<span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">A resolver can be set as default with <code>MessagePackSerializer.DefaultOptions = options</code>, but <strong>WARNING</strong>: When developing an application where you control all MessagePack-related code it may be safe to rely on this mutable static to control behavior. For all other libraries or multi-purpose applications that use <code>MessagePackSerializer</code> you should explicitly specify the <code>MessagePackSerializerOptions</code> to use with each method invocation to guarantee your code behaves as you expect even when sharing an <code>AppDomain</code> or process with other MessagePack users that may change this static property.</p> <p dir="auto">Here is sample of use <code>DynamicEnumAsStringResolver</code> with <code>DynamicContractlessObjectResolver</code> (It is Json.NET-like lightweight setting.)</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// composite same as StandardResolver var resolver = MessagePack.Resolvers.CompositeResolver.Create( MessagePack.Resolvers.BuiltinResolver.Instance, MessagePack.Resolvers.AttributeFormatterResolver.Instance, // replace enum resolver MessagePack.Resolvers.DynamicEnumAsStringResolver.Instance, MessagePack.Resolvers.DynamicGenericResolver.Instance, MessagePack.Resolvers.DynamicUnionResolver.Instance, MessagePack.Resolvers.DynamicObjectResolver.Instance, MessagePack.Resolvers.PrimitiveObjectResolver.Instance, // final fallback(last priority) MessagePack.Resolvers.DynamicContractlessObjectResolver.Instance );"><pre><span class="pl-c">// composite same as StandardResolver</span> <span class="pl-smi">var</span> <span class="pl-s1">resolver</span> <span class="pl-c1">=</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>CompositeResolver<span class="pl-kos">.</span><span class="pl-en">Create</span><span class="pl-kos">(</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>BuiltinResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>AttributeFormatterResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> <span class="pl-c">// replace enum resolver</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>DynamicEnumAsStringResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>DynamicGenericResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>DynamicUnionResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>DynamicObjectResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>PrimitiveObjectResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> <span class="pl-c">// final fallback(last priority)</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>DynamicContractlessObjectResolver<span class="pl-kos">.</span>Instance <span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">If you want to make an extension package, you should write both a formatter and resolver for easier consumption. Here is sample of a resolver:</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class SampleCustomResolver : IFormatterResolver { // Resolver should be singleton. public static readonly IFormatterResolver Instance = new SampleCustomResolver(); private SampleCustomResolver() { } // GetFormatter&lt;T&gt;'s get cost should be minimized so use type cache. public IMessagePackFormatter&lt;T&gt; GetFormatter&lt;T&gt;() { return FormatterCache&lt;T&gt;.Formatter; } private static class FormatterCache&lt;T&gt; { public static readonly IMessagePackFormatter&lt;T&gt; Formatter; // generic's static constructor should be minimized for reduce type generation size! // use outer helper method. static FormatterCache() { Formatter = (IMessagePackFormatter&lt;T&gt;)SampleCustomResolverGetFormatterHelper.GetFormatter(typeof(T)); } } } internal static class SampleCustomResolverGetFormatterHelper { // If type is concrete type, use type-formatter map static readonly Dictionary&lt;Type, object&gt; formatterMap = new Dictionary&lt;Type, object&gt;() { {typeof(FileInfo), new FileInfoFormatter()} // add more your own custom serializers. }; internal static object GetFormatter(Type t) { object formatter; if (formatterMap.TryGetValue(t, out formatter)) { return formatter; } // If type can not get, must return null for fallback mechanism. return null; } }"><pre><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">SampleCustomResolver</span> <span class="pl-c1">:</span> <span class="pl-smi">IFormatterResolver</span> <span class="pl-kos">{</span> <span class="pl-c">// Resolver should be singleton.</span> <span class="pl-k">public</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-k">readonly</span> <span class="pl-smi">IFormatterResolver</span> <span class="pl-s1">Instance</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> SampleCustomResolver<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">private</span> <span class="pl-v">SampleCustomResolver</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> <span class="pl-c">// GetFormatter&lt;T&gt;'s get cost should be minimized so use type cache.</span> <span class="pl-k">public</span> <span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-en">GetFormatter</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">FormatterCache</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">.</span>Formatter<span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">private</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-k">class</span> <span class="pl-smi">FormatterCache</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">public</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-k">readonly</span> <span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">Formatter</span><span class="pl-kos">;</span> <span class="pl-c">// generic's static constructor should be minimized for reduce type generation size!</span> <span class="pl-c">// use outer helper method.</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-v">FormatterCache</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">Formatter</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span>SampleCustomResolverGetFormatterHelper<span class="pl-kos">.</span><span class="pl-en">GetFormatter</span><span class="pl-kos">(</span><span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">T</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-k">internal</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-k">class</span> <span class="pl-smi">SampleCustomResolverGetFormatterHelper</span> <span class="pl-kos">{</span> <span class="pl-c">// If type is concrete type, use type-formatter map</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-k">readonly</span> <span class="pl-smi">Dictionary</span><span class="pl-c1">&lt;</span><span class="pl-smi">Type</span><span class="pl-kos">,</span> <span class="pl-smi">object</span><span class="pl-c1">&gt;</span> <span class="pl-s1">formatterMap</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Dictionary</span><span class="pl-c1">&lt;</span><span class="pl-smi">Type</span><span class="pl-kos">,</span> <span class="pl-smi">object</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">{</span><span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">FileInfo</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-k">new</span> FileInfoFormatter<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span> <span class="pl-c">// add more your own custom serializers.</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">internal</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-smi">object</span> <span class="pl-en">GetFormatter</span><span class="pl-kos">(</span><span class="pl-smi">Type</span> <span class="pl-s1">t</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">object</span> <span class="pl-s1">formatter</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span>formatterMap<span class="pl-kos">.</span><span class="pl-en">TryGetValue</span><span class="pl-kos">(</span>t<span class="pl-kos">,</span> <span class="pl-k">out</span> formatter<span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">formatter</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-c">// If type can not get, must return null for fallback mechanism.</span> <span class="pl-k">return</span> <span class="pl-c1">null</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">MessagePackFormatterAttribute</h2><a id="user-content-messagepackformatterattribute" class="anchor" aria-label="Permalink: MessagePackFormatterAttribute" href="#messagepackformatterattribute"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePackFormatterAttribute is a lightweight extension point of class, struct, interface, enum and property/field. This is like Json.NET's JsonConverterAttribute. For example, serialize private field, serialize x10 formatter.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[MessagePackFormatter(typeof(CustomObjectFormatter))] public class CustomObject { string internalId; public CustomObject() { this.internalId = Guid.NewGuid().ToString(); } // serialize/deserialize internal field. class CustomObjectFormatter : IMessagePackFormatter&lt;CustomObject&gt; { public void Serialize(ref MessagePackWriter writer, CustomObject value, MessagePackSerializerOptions options) { options.Resolver.GetFormatterWithVerify&lt;string&gt;().Serialize(ref writer, value.internalId, options); } public CustomObject Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { var id = options.Resolver.GetFormatterWithVerify&lt;string&gt;().Deserialize(ref reader, options); return new CustomObject { internalId = id }; } } } // per field, member public class Int_x10Formatter : IMessagePackFormatter&lt;int&gt; { public int Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { return reader.ReadInt32() * 10; } public void Serialize(ref MessagePackWriter writer, int value, MessagePackSerializerOptions options) { writer.WriteInt32(value * 10); } } [MessagePackObject] public class MyClass { // You can attach custom formatter per member. [Key(0)] [MessagePackFormatter(typeof(Int_x10Formatter))] public int MyProperty1 { get; set; } }"><pre><span class="pl-kos">[</span><span class="pl-c1">MessagePackFormatter<span class="pl-kos">(</span><span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">CustomObjectFormatter</span><span class="pl-kos">)</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">CustomObject</span> <span class="pl-kos">{</span> <span class="pl-smi">string</span> <span class="pl-s1">internalId</span><span class="pl-kos">;</span> <span class="pl-k">public</span> <span class="pl-v">CustomObject</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">this</span><span class="pl-kos">.</span>internalId <span class="pl-c1">=</span> Guid<span class="pl-kos">.</span><span class="pl-en">NewGuid</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">ToString</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-c">// serialize/deserialize internal field.</span> <span class="pl-k">class</span> <span class="pl-smi">CustomObjectFormatter</span> <span class="pl-c1">:</span> <span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">CustomObject</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">Serialize</span><span class="pl-kos">(</span><span class="pl-k">ref</span> <span class="pl-smi">MessagePackWriter</span> <span class="pl-s1">writer</span><span class="pl-kos">,</span> <span class="pl-smi">CustomObject</span> <span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> options<span class="pl-kos">.</span>Resolver<span class="pl-kos">.</span><span class="pl-smi">GetFormatterWithVerify</span><span class="pl-c1">&lt;</span><span class="pl-smi">string</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">Serialize</span><span class="pl-kos">(</span><span class="pl-k">ref</span> writer<span class="pl-kos">,</span> value<span class="pl-kos">.</span>internalId<span class="pl-kos">,</span> options<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> CustomObject <span class="pl-en">Deserialize</span><span class="pl-kos">(</span><span class="pl-k">ref</span> <span class="pl-smi">MessagePackReader</span> <span class="pl-s1">reader</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">var</span> <span class="pl-s1">id</span> <span class="pl-c1">=</span> options<span class="pl-kos">.</span>Resolver<span class="pl-kos">.</span><span class="pl-smi">GetFormatterWithVerify</span><span class="pl-c1">&lt;</span><span class="pl-smi">string</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">Deserialize</span><span class="pl-kos">(</span><span class="pl-k">ref</span> reader<span class="pl-kos">,</span> options<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-k">new</span> CustomObject <span class="pl-kos">{</span> <span class="pl-s1">internalId</span> <span class="pl-c1">=</span> <span class="pl-s1">id</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-c">// per field, member</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Int_x10Formatter</span> <span class="pl-c1">:</span> <span class="pl-smi">IMessagePackFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">int</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-en">Deserialize</span><span class="pl-kos">(</span><span class="pl-k">ref</span> <span class="pl-smi">MessagePackReader</span> <span class="pl-s1">reader</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> reader<span class="pl-kos">.</span><span class="pl-en">ReadInt32</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">*</span> <span class="pl-c1">10</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-en">Serialize</span><span class="pl-kos">(</span><span class="pl-k">ref</span> <span class="pl-smi">MessagePackWriter</span> <span class="pl-s1">writer</span><span class="pl-kos">,</span> <span class="pl-smi">int</span> <span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-smi">MessagePackSerializerOptions</span> <span class="pl-s1">options</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> writer<span class="pl-kos">.</span><span class="pl-en">WriteInt32</span><span class="pl-kos">(</span><span class="pl-s1">value</span> <span class="pl-c1">*</span> <span class="pl-c1">10</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackObject</span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">MyClass</span> <span class="pl-kos">{</span> <span class="pl-c">// You can attach custom formatter per member.</span> <span class="pl-kos">[</span><span class="pl-c1">Key<span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-kos">[</span><span class="pl-c1">MessagePackFormatter<span class="pl-kos">(</span><span class="pl-k">typeof</span><span class="pl-kos">(</span><span class="pl-smi">Int_x10Formatter</span><span class="pl-kos">)</span><span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k">public</span> <span class="pl-smi">int</span> <span class="pl-s1">MyProperty1</span> <span class="pl-kos">{</span> <span class="pl-k">get</span><span class="pl-kos">;</span> <span class="pl-k">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">Formatter is retrieved by <code>AttributeFormatterResolver</code>, it is included in <code>StandardResolver</code>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">IgnoreFormatter</h2><a id="user-content-ignoreformatter" class="anchor" aria-label="Permalink: IgnoreFormatter" href="#ignoreformatter"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><code>IgnoreFormatter&lt;T&gt;</code> is lightweight extension point of class and struct. If there exists types that can't be serialized, you can register <code>IgnoreFormatter&lt;T&gt;</code> that serializes those to nil/null.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// CompositeResolver can set custom formatter. var resolver = MessagePack.Resolvers.CompositeResolver.Create( new IMessagePackFormatter[] { // for example, register reflection infos (can not serialize) new IgnoreFormatter&lt;MethodBase&gt;(), new IgnoreFormatter&lt;MethodInfo&gt;(), new IgnoreFormatter&lt;PropertyInfo&gt;(), new IgnoreFormatter&lt;FieldInfo&gt;() }, new IFormatterResolver[] { ContractlessStandardResolver.Instance });"><pre><span class="pl-c">// CompositeResolver can set custom formatter.</span> <span class="pl-smi">var</span> <span class="pl-s1">resolver</span> <span class="pl-c1">=</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>CompositeResolver<span class="pl-kos">.</span><span class="pl-en">Create</span><span class="pl-kos">(</span> <span class="pl-k">new</span> IMessagePackFormatter<span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-kos">{</span> <span class="pl-c">// for example, register reflection infos (can not serialize)</span> <span class="pl-k">new</span> <span class="pl-smi">IgnoreFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">MethodBase</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-smi">IgnoreFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">MethodInfo</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-smi">IgnoreFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">PropertyInfo</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-smi">IgnoreFormatter</span><span class="pl-c1">&lt;</span><span class="pl-smi">FieldInfo</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">new</span> IFormatterResolver<span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-kos">{</span> ContractlessStandardResolver<span class="pl-kos">.</span>Instance <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Reserved Extension Types</h2><a id="user-content-reserved-extension-types" class="anchor" aria-label="Permalink: Reserved Extension Types" href="#reserved-extension-types"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePack for C# already used some MessagePack extension type codes, be careful to avoid using the same ext code for other purposes.</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Range</th> <th>Reserved for</th> </tr> </thead> <tbody> <tr> <td>[-128, -1]</td> <td>Reserved by the msgpack spec for predefined types</td> </tr> <tr> <td>[30, 120)</td> <td>Reserved for this library's use to support common types in .NET</td> </tr> </tbody> </table></markdown-accessiblity-table> <p dir="auto">This leaves the following ranges for your use:</p> <ul dir="auto"> <li>[0, 30)</li> <li>[120, 127]</li> </ul> <p dir="auto">Within the <em>reserved</em> ranges, this library defines or implements extensions that use these type codes:</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Code</th> <th>Type</th> <th>Use by</th> </tr> </thead> <tbody> <tr> <td>-1</td> <td>DateTime</td> <td>MessagePack-spec reserved for timestamp</td> </tr> <tr> <td>30</td> <td>Vector2[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>31</td> <td>Vector3[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>32</td> <td>Vector4[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>33</td> <td>Quaternion[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>34</td> <td>Color[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>35</td> <td>Bounds[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>36</td> <td>Rect[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>37</td> <td>Int[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>38</td> <td>Float[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>39</td> <td>Double[]</td> <td>for Unity, UnsafeBlitFormatter</td> </tr> <tr> <td>98</td> <td>All</td> <td>MessagePackCompression.Lz4BlockArray</td> </tr> <tr> <td>99</td> <td>All</td> <td>MessagePackCompression.Lz4Block</td> </tr> <tr> <td>100</td> <td>object</td> <td>TypelessFormatter</td> </tr> </tbody> </table></markdown-accessiblity-table> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Unity support</h2><a id="user-content-unity-support" class="anchor" aria-label="Permalink: Unity support" href="#unity-support"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Unity lowest supported version is <code>2018.3</code>, API Compatibility Level supports both <code>.NET 4.x</code> and <code>.NET Standard 2.0</code>.</p> <p dir="auto">You can install the <code>unitypackage</code> from the <a href="https://github.com/MessagePack-CSharp/MessagePack-CSharp/releases">Releases</a> page. If your build targets .NET Framework 4.x and runs on mono, you can use it as is. But if your build targets IL2CPP, you can not use <code>Dynamic***Resolver</code>, so it is required to use pre-code generation. Please see <a href="#aot">pre-code generation section</a>.</p> <p dir="auto">MessagePack for C# includes some additional <code>System.*.dll</code> libraries that originally provides in NuGet. They are located under <code>Plugins</code>. If other packages use these libraries (e.g. Unity Collections package using <code>System.Runtime.CompilerServices.Unsafe.dll</code>), to avoid conflicts, please delete the DLL under <code>Plugins</code>.</p> <p dir="auto">Currently <code>CompositeResolver.Create</code> does not work on IL2CPP, so it is recommended to use <code>StaticCompositeResolver.Instance.Register</code> instead.</p> <p dir="auto">In Unity, MessagePackSerializer can serialize <code>Vector2</code>, <code>Vector3</code>, <code>Vector4</code>, <code>Quaternion</code>, <code>Color</code>, <code>Bounds</code>, <code>Rect</code>, <code>AnimationCurve</code>, <code>Keyframe</code>, <code>Matrix4x4</code>, <code>Gradient</code>, <code>Color32</code>, <code>RectOffset</code>, <code>LayerMask</code>, <code>Vector2Int</code>, <code>Vector3Int</code>, <code>RangeInt</code>, <code>RectInt</code>, <code>BoundsInt</code> and their nullable, array and list types with the built-in extension <code>UnityResolver</code>. It is included in StandardResolver by default.</p> <p dir="auto">MessagePack for C# has an additional unsafe extension. <code>UnsafeBlitResolver</code> is special resolver for extremely fast but unsafe serialization/deserialization of struct arrays.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/46207/23837633/76589924-07ce-11e7-8b26-e50eab548938.png"><img src="https://cloud.githubusercontent.com/assets/46207/23837633/76589924-07ce-11e7-8b26-e50eab548938.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">x20 faster Vector3[] serialization than native JsonUtility. If use <code>UnsafeBlitResolver</code>, serialization uses a special format (ext:typecode 30~39) for <code>Vector2[]</code>, <code>Vector3[]</code>, <code>Quaternion[]</code>, <code>Color[]</code>, <code>Bounds[]</code>, <code>Rect[]</code>. If use <code>UnityBlitWithPrimitiveArrayResolver</code>, it supports <code>int[]</code>, <code>float[]</code>, <code>double[]</code> too. This special feature is useful for serializing Mesh (many <code>Vector3[]</code>) or many transform positions.</p> <p dir="auto">If you want to use unsafe resolver, register <code>UnityBlitResolver</code> or <code>UnityBlitWithPrimitiveArrayResolver</code>.</p> <p dir="auto">Here is sample of configuration.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="StaticCompositeResolver.Instance.Register( MessagePack.Unity.UnityResolver.Instance, MessagePack.Unity.Extension.UnityBlitWithPrimitiveArrayResolver.Instance, MessagePack.Resolvers.StandardResolver.Instance ); var options = MessagePackSerializerOptions.Standard.WithResolver(StaticCompositeResolver.Instance); MessagePackSerializer.DefaultOptions = options;"><pre>StaticCompositeResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">.</span><span class="pl-en">Register</span><span class="pl-kos">(</span> MessagePack<span class="pl-kos">.</span>Unity<span class="pl-kos">.</span>UnityResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Unity<span class="pl-kos">.</span>Extension<span class="pl-kos">.</span>UnityBlitWithPrimitiveArrayResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>StandardResolver<span class="pl-kos">.</span>Instance <span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> MessagePackSerializerOptions<span class="pl-kos">.</span>Standard<span class="pl-kos">.</span><span class="pl-en">WithResolver</span><span class="pl-kos">(</span>StaticCompositeResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">)</span><span class="pl-kos">;</span> MessagePackSerializer<span class="pl-kos">.</span>DefaultOptions <span class="pl-c1">=</span> <span class="pl-s1">options</span><span class="pl-kos">;</span></pre></div> <p dir="auto">The <code>MessagePack.UnityShims</code> NuGet package is for .NET server-side serialization support to communicate with Unity. It includes shims for Vector3 etc and the Safe/Unsafe serialization extension.</p> <p dir="auto">If you want to share a class between Unity and a server, you can use <code>SharedProject</code> or <code>Reference as Link</code> or a glob reference (with <code>LinkBase</code>), etc. Anyway, you need to share at source-code level. This is a sample project structure using a glob reference (recommended).</p> <ul dir="auto"> <li>ServerProject(.NET Framework 4.6/.NET/.NET Standard) <ul dir="auto"> <li>[<code>&lt;Compile Include="..\UnityProject\Assets\Scripts\Shared\**\*.cs" LinkBase="Shared" /&gt;</code>]</li> <li>[MessagePack]</li> <li>[MessagePack.UnityShims]</li> </ul> </li> <li>UnityProject <ul dir="auto"> <li>[Concrete SharedCodes]</li> <li>[MessagePack](not dll/NuGet, use MessagePack.Unity.unitypackage's sourcecode)</li> </ul> </li> </ul> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-aot"></a>AOT Code Generation (support for Unity/Xamarin)</h2><a id="user-content-aot-code-generation-support-for-unityxamarin" class="anchor" aria-label="Permalink: AOT Code Generation (support for Unity/Xamarin)" href="#aot-code-generation-support-for-unityxamarin"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">By default, MessagePack for C# serializes custom objects by <a href="https://msdn.microsoft.com/en-us/library/system.reflection.emit.ilgenerator.aspx" rel="nofollow">generating IL</a> on the fly at runtime to create custom, highly tuned formatters for each type. This code generation has a minor upfront performance cost. Because strict-AOT environments such as Xamarin and Unity IL2CPP forbid runtime code generation, MessagePack provides a way for you to run a code generator ahead of time as well.</p> <blockquote> <p dir="auto">Note: When using Unity, dynamic code generation only works when targeting .NET Framework 4.x + mono runtime. For all other Unity targets, AOT is required.</p> </blockquote> <p dir="auto">If you want to avoid the upfront dynamic generation cost or you need to run on Xamarin or Unity, you need AOT code generation. <code>mpc</code> (MessagePackCompiler) is the code generator of MessagePack for C#. mpc uses <a href="https://github.com/dotnet/roslyn">Roslyn</a> to analyze source code.</p> <p dir="auto">First of all, mpc requires <a href="https://dotnet.microsoft.com/download" rel="nofollow">.NET 6+ Runtime</a>. The easiest way to acquire and run mpc is as a dotnet tool.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dotnet tool install --global MessagePack.Generator"><pre class="notranslate"><code>dotnet tool install --global MessagePack.Generator </code></pre></div> <p dir="auto">Installing it as a local tool allows you to include the tools and versions that you use in your source control system. Run these commands in the root of your repo:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dotnet new tool-manifest dotnet tool install MessagePack.Generator"><pre class="notranslate"><code>dotnet new tool-manifest dotnet tool install MessagePack.Generator </code></pre></div> <p dir="auto">Check in your <code>.config\dotnet-tools.json</code> file. On another machine you can "restore" your tool using the <code>dotnet tool restore</code> command.</p> <p dir="auto">Once you have the tool installed, simply invoke using <code>dotnet mpc</code> within your repo:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dotnet mpc --help Usage: mpc [options...] Options: -i, -input &lt;String&gt; Input path to MSBuild project file or the directory containing Unity source files. (Required) -o, -output &lt;String&gt; Output file path(.cs) or directory(multiple generate file). (Required) -c, -conditionalSymbol &lt;String&gt; Conditional compiler symbols, split with ','. (Default: null) -r, -resolverName &lt;String&gt; Set resolver name. (Default: GeneratedResolver) -n, -namespace &lt;String&gt; Set namespace root name. (Default: MessagePack) -m, -useMapMode &lt;Boolean&gt; Force use map mode serialization. (Default: False) -ms, -multipleIfDirectiveOutputSymbols &lt;String&gt; Generate #if-- files by symbols, split with ','. (Default: null)"><pre class="notranslate"><code>dotnet mpc --help Usage: mpc [options...] Options: -i, -input &lt;String&gt; Input path to MSBuild project file or the directory containing Unity source files. (Required) -o, -output &lt;String&gt; Output file path(.cs) or directory(multiple generate file). (Required) -c, -conditionalSymbol &lt;String&gt; Conditional compiler symbols, split with ','. (Default: null) -r, -resolverName &lt;String&gt; Set resolver name. (Default: GeneratedResolver) -n, -namespace &lt;String&gt; Set namespace root name. (Default: MessagePack) -m, -useMapMode &lt;Boolean&gt; Force use map mode serialization. (Default: False) -ms, -multipleIfDirectiveOutputSymbols &lt;String&gt; Generate #if-- files by symbols, split with ','. (Default: null) </code></pre></div> <p dir="auto"><code>mpc</code> targets C# code with <code>[MessagePackObject]</code> or <code>[Union]</code> annotations.</p> <div class="highlight highlight-source-batchfile notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Simple Sample: dotnet mpc -i &quot;..\src\Sandbox.Shared.csproj&quot; -o &quot;MessagePackGenerated.cs&quot; // Use force map simulate DynamicContractlessObjectResolver dotnet mpc -i &quot;..\src\Sandbox.Shared.csproj&quot; -o &quot;MessagePackGenerated.cs&quot; -m"><pre>// Simple Sample: dotnet mpc -i <span class="pl-s"><span class="pl-pds">"</span>..\src\Sandbox.Shared.csproj<span class="pl-pds">"</span></span> -o <span class="pl-s"><span class="pl-pds">"</span>MessagePackGenerated.cs<span class="pl-pds">"</span></span> // Use force map simulate DynamicContractlessObjectResolver dotnet mpc -i <span class="pl-s"><span class="pl-pds">"</span>..\src\Sandbox.Shared.csproj<span class="pl-pds">"</span></span> -o <span class="pl-s"><span class="pl-pds">"</span>MessagePackGenerated.cs<span class="pl-pds">"</span></span> -m</pre></div> <p dir="auto">By default, <code>mpc</code> generates the resolver as <code>MessagePack.Resolvers.GeneratedResolver</code> and formatters as<code>MessagePack.Formatters.*</code>.</p> <p dir="auto">Here is the full sample code to register a generated resolver in Unity.</p> <div class="highlight highlight-source-cs notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using MessagePack; using MessagePack.Resolvers; using UnityEngine; public class Startup { static bool serializerRegistered = false; [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] static void Initialize() { if (!serializerRegistered) { StaticCompositeResolver.Instance.Register( MessagePack.Resolvers.GeneratedResolver.Instance, MessagePack.Resolvers.StandardResolver.Instance ); var option = MessagePackSerializerOptions.Standard.WithResolver(StaticCompositeResolver.Instance); MessagePackSerializer.DefaultOptions = option; serializerRegistered = true; } } #if UNITY_EDITOR [UnityEditor.InitializeOnLoadMethod] static void EditorInitialize() { Initialize(); } #endif }"><pre><span class="pl-k">using</span> MessagePack<span class="pl-kos">;</span> <span class="pl-k">using</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">;</span> <span class="pl-k">using</span> UnityEngine<span class="pl-kos">;</span> <span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Startup</span> <span class="pl-kos">{</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-smi">bool</span> <span class="pl-s1">serializerRegistered</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span> <span class="pl-kos">[</span><span class="pl-c1">RuntimeInitializeOnLoadMethod<span class="pl-kos">(</span>RuntimeInitializeLoadType<span class="pl-kos">.</span>BeforeSceneLoad<span class="pl-kos">)</span></span><span class="pl-kos">]</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-smi">void</span> <span class="pl-en">Initialize</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">serializerRegistered</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> StaticCompositeResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">.</span><span class="pl-en">Register</span><span class="pl-kos">(</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>GeneratedResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">,</span> MessagePack<span class="pl-kos">.</span>Resolvers<span class="pl-kos">.</span>StandardResolver<span class="pl-kos">.</span>Instance <span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">var</span> <span class="pl-s1">option</span> <span class="pl-c1">=</span> MessagePackSerializerOptions<span class="pl-kos">.</span>Standard<span class="pl-kos">.</span><span class="pl-en">WithResolver</span><span class="pl-kos">(</span>StaticCompositeResolver<span class="pl-kos">.</span>Instance<span class="pl-kos">)</span><span class="pl-kos">;</span> MessagePackSerializer<span class="pl-kos">.</span>DefaultOptions <span class="pl-c1">=</span> <span class="pl-s1">option</span><span class="pl-kos">;</span> <span class="pl-s1">serializerRegistered</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> #<span class="pl-k">if</span> UNITY_EDITOR <span class="pl-kos">[</span><span class="pl-c1">UnityEditor<span class="pl-kos">.</span>InitializeOnLoadMethod</span><span class="pl-kos">]</span> <span class="pl-k"><span class="pl-k">static</span></span> <span class="pl-smi">void</span> <span class="pl-en">EditorInitialize</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> Initialize<span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> #endif <span class="pl-kos">}</span></pre></div> <p dir="auto">In Unity, you can use MessagePack CodeGen windows at <code>Windows -&gt; MessagePack -&gt; CodeGenerator</code>.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/46207/69414381-f14da400-0d55-11ea-9f8d-9af448d347dc.png"><img src="https://user-images.githubusercontent.com/46207/69414381-f14da400-0d55-11ea-9f8d-9af448d347dc.png" alt="" style="max-width: 100%;"></a></p> <p dir="auto">Install the .NET runtime, install mpc (as a .NET Tool as described above), and execute <code>dotnet mpc</code>. Currently this tool is experimental so please tell me your opinion.</p> <p dir="auto">In Xamarin, you can install the <a href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/doc/msbuildtask.md">the <code>MessagePack.MSBuild.Tasks</code> NuGet package</a> into your projects to pre-compile fast serialization code and run in environments where JIT compilation is not allowed.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">RPC</h2><a id="user-content-rpc" class="anchor" aria-label="Permalink: RPC" href="#rpc"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">MessagePack advocated <a href="https://github.com/msgpack-rpc/msgpack-rpc">MessagePack RPC</a>, but work on it has stopped and it is not widely used.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">MagicOnion</h3><a id="user-content-magiconion" class="anchor" aria-label="Permalink: MagicOnion" href="#magiconion"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">I've created a gRPC based MessagePack HTTP/2 RPC streaming framework called <a href="https://github.com/Cysharp/MagicOnion">MagicOnion</a>. gRPC usually communicates with Protocol Buffers using IDL. But MagicOnion uses MessagePack for C# and does not need IDL. When communicating C# to C#, schemaless (or rather C# classes as schema) is better than using IDL.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">StreamJsonRpc</h3><a id="user-content-streamjsonrpc" class="anchor" aria-label="Permalink: StreamJsonRpc" href="#streamjsonrpc"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The StreamJsonRpc library is based on <a href="https://www.jsonrpc.org/" rel="nofollow">JSON-RPC</a> and includes <a href="https://github.com/microsoft/vs-streamjsonrpc/blob/master/doc/extensibility.md#alternative-formatters">a pluggable formatter architecture</a> and as of v2.3 includes <a href="https://github.com/microsoft/vs-streamjsonrpc/blob/master/doc/extensibility.md#message-formatterss">MessagePack support</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">How to build</h2><a id="user-content-how-to-build" class="anchor" aria-label="Permalink: How to build" href="#how-to-build"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">See our <a href="/MessagePack-CSharp/MessagePack-CSharp/blob/master/CONTRIBUTING.md">contributor's guide</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-coc"></a>Code of Conduct</h2><a id="user-content-code-of-conduct" class="anchor" aria-label="Permalink: Code of Conduct" href="#code-of-conduct"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the <a href="https://dotnetfoundation.org/code-of-conduct" rel="nofollow">.NET Foundation Code of Conduct</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">.NET Foundation</h2><a id="user-content-net-foundation" class="anchor" aria-label="Permalink: .NET Foundation" href="#net-foundation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This project is supported by the <a href="https://dotnetfoundation.org" rel="nofollow">.NET Foundation</a>.</p> </article></div></div></div></div></div> <!-- --> <!-- --> <script type="application/json" id="__PRIMER_DATA_:R0:__">{"resolvedServerColorMode":"day"}</script></div> </react-partial> <input type="hidden" data-csrf="true" value="e6uGlFk6gdXGAY+yvjH4s7pfRp/WXqFS4JOMWBT7Pr8R4PTK6vZBxXG8sICtYEPknH6lEaAXX5YljRMxU2UxIw==" /> </div> <div data-view-component="true" class="Layout-sidebar"> <div class="BorderGrid about-margin" data-pjax> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <div class="hide-sm hide-md"> <h2 class="mb-3 h4">About</h2> <p class="f4 my-3"> Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] </p> <h3 class="sr-only">Topics</h3> <div class="my-3"> <div class="f6"> <a data-ga-click="Topic, repository page" data-octo-click="topic_click" data-octo-dimensions="topic:c-sharp" href="/topics/c-sharp" title="Topic: c-sharp" data-view-component="true" class="topic-tag topic-tag-link"> c-sharp </a> <a data-ga-click="Topic, repository page" data-octo-click="topic_click" data-octo-dimensions="topic:serialization" href="/topics/serialization" title="Topic: serialization" data-view-component="true" class="topic-tag topic-tag-link"> serialization </a> <a data-ga-click="Topic, repository page" data-octo-click="topic_click" data-octo-dimensions="topic:xamarin" href="/topics/xamarin" title="Topic: xamarin" data-view-component="true" class="topic-tag topic-tag-link"> xamarin </a> <a data-ga-click="Topic, repository page" data-octo-click="topic_click" data-octo-dimensions="topic:unity" href="/topics/unity" title="Topic: unity" data-view-component="true" class="topic-tag topic-tag-link"> unity </a> <a data-ga-click="Topic, repository page" data-octo-click="topic_click" data-octo-dimensions="topic:serializer" href="/topics/serializer" title="Topic: serializer" data-view-component="true" class="topic-tag topic-tag-link"> serializer </a> <a data-ga-click="Topic, repository page" data-octo-click="topic_click" data-octo-dimensions="topic:msgpack" href="/topics/msgpack" title="Topic: msgpack" data-view-component="true" class="topic-tag topic-tag-link"> msgpack </a> <a data-ga-click="Topic, repository page" data-octo-click="topic_click" data-octo-dimensions="topic:messagepack" href="/topics/messagepack" title="Topic: messagepack" data-view-component="true" class="topic-tag topic-tag-link"> messagepack </a> <a data-ga-click="Topic, repository page" data-octo-click="topic_click" data-octo-dimensions="topic:lz4" href="/topics/lz4" title="Topic: lz4" data-view-component="true" class="topic-tag topic-tag-link"> lz4 </a> </div> </div> <h3 class="sr-only">Resources</h3> <div class="mt-2"> <a class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:readme&quot;}" href="#readme-ov-file"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book mr-2"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> Readme </a> </div> <h3 class="sr-only">License</h3> <div class="mt-2"> <a href="#License-1-ov-file" class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:license&quot;}" > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-law mr-2"> <path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path> </svg> View license </a> </div> <h3 class="sr-only">Security policy</h3> <div class="mt-2"> <a href="#security-ov-file" class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:security policy&quot;}" > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-law mr-2"> <path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path> </svg> Security policy </a> </div> <include-fragment src="/MessagePack-CSharp/MessagePack-CSharp/hovercards/citation/sidebar_partial?tree_name=master"> </include-fragment> <div class="mt-2"> <a href="/MessagePack-CSharp/MessagePack-CSharp/activity" data-view-component="true" class="Link Link--muted"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pulse mr-2"> <path d="M6 2c.306 0 .582.187.696.471L10 10.731l1.304-3.26A.751.751 0 0 1 12 7h3.25a.75.75 0 0 1 0 1.5h-2.742l-1.812 4.528a.751.751 0 0 1-1.392 0L6 4.77 4.696 8.03A.75.75 0 0 1 4 8.5H.75a.75.75 0 0 1 0-1.5h2.742l1.812-4.529A.751.751 0 0 1 6 2Z"></path> </svg> <span class="color-fg-muted">Activity</span> </a> </div> <div class="mt-2"> <a href="/MessagePack-CSharp/MessagePack-CSharp/custom-properties" data-view-component="true" class="Link Link--muted"> <svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-note mr-2"> <path d="M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25Zm1.75-.25a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25ZM3.5 6.25a.75.75 0 0 1 .75-.75h7a.75.75 0 0 1 0 1.5h-7a.75.75 0 0 1-.75-.75Zm.75 2.25h4a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1 0-1.5Z"></path> </svg> <span class="color-fg-muted">Custom properties</span> </a> </div> <h3 class="sr-only">Stars</h3> <div class="mt-2"> <a href="/MessagePack-CSharp/MessagePack-CSharp/stargazers" data-view-component="true" class="Link Link--muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> <strong>5.8k</strong> stars </a> </div> <h3 class="sr-only">Watchers</h3> <div class="mt-2"> <a href="/MessagePack-CSharp/MessagePack-CSharp/watchers" data-view-component="true" class="Link Link--muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-eye mr-2"> <path d="M8 2c1.981 0 3.671.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.62 1.62 0 0 1 0 1.798c-.45.678-1.367 1.932-2.637 3.023C11.67 13.008 9.981 14 8 14c-1.981 0-3.671-.992-4.933-2.078C1.797 10.83.88 9.576.43 8.898a1.62 1.62 0 0 1 0-1.798c.45-.677 1.367-1.931 2.637-3.022C4.33 2.992 6.019 2 8 2ZM1.679 7.932a.12.12 0 0 0 0 .136c.411.622 1.241 1.75 2.366 2.717C5.176 11.758 6.527 12.5 8 12.5c1.473 0 2.825-.742 3.955-1.715 1.124-.967 1.954-2.096 2.366-2.717a.12.12 0 0 0 0-.136c-.412-.621-1.242-1.75-2.366-2.717C10.824 4.242 9.473 3.5 8 3.5c-1.473 0-2.825.742-3.955 1.715-1.124.967-1.954 2.096-2.366 2.717ZM8 10a2 2 0 1 1-.001-3.999A2 2 0 0 1 8 10Z"></path> </svg> <strong>145</strong> watching </a> </div> <h3 class="sr-only">Forks</h3> <div class="mt-2"> <a href="/MessagePack-CSharp/MessagePack-CSharp/forks" data-view-component="true" class="Link Link--muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg> <strong>700</strong> forks </a> </div> <div class="mt-2"> <a class="Link--muted" href="/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2FMessagePack-CSharp%2FMessagePack-CSharp&amp;report=MessagePack-CSharp+%28user%29"> Report repository </a> </div> </div> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame"> <a href="/MessagePack-CSharp/MessagePack-CSharp/releases" data-view-component="true" class="Link--primary no-underline Link"> Releases <span title="82" data-view-component="true" class="Counter">82</span> </a></h2> <a class="Link--primary d-flex no-underline" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/MessagePack-CSharp/MessagePack-CSharp/releases/tag/v2.5.192"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-tag flex-shrink-0 mt-1 color-fg-success"> <path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path> </svg> <div class="ml-2 min-width-0"> <div class="d-flex"> <span class="css-truncate css-truncate-target text-bold mr-2" style="max-width: none;">v2.5.192</span> <span title="Label: Latest" data-view-component="true" class="Label Label--success flex-shrink-0"> Latest </span> </div> <div class="text-small color-fg-muted"><relative-time datetime="2024-11-14T12:57:57Z" class="no-wrap">Nov 14, 2024</relative-time></div> </div> </a> <div data-view-component="true" class="mt-3"> <a text="small" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/MessagePack-CSharp/MessagePack-CSharp/releases" data-view-component="true" class="Link"> + 81 releases </a></div> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3">Sponsor this project</h2> <include-fragment src="/MessagePack-CSharp/MessagePack-CSharp/sponsors_list?block_button=false&amp;current_repository=MessagePack-CSharp" aria-busy="true" aria-label="Loading sponsorable links"> <ul class="list-style-none"> <li class="mb-2 d-flex"> <div class="Skeleton avatar avatar-user mr-2" style="width:32px;height:32px;"></div> <div class="Skeleton Skeleton--text flex-1 flex-self-center f4">&nbsp;</div> </li> <li class="mb-2 d-flex"> <div class="Skeleton avatar avatar-user mr-2" style="width:32px;height:32px;"></div> <div class="Skeleton Skeleton--text flex-1 flex-self-center f4">&nbsp;</div> </li> </ul> </include-fragment> <div class="text-small mt-3"> <a href="/sponsors">Learn more about GitHub Sponsors</a> </div> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3"> <a href="/orgs/MessagePack-CSharp/packages?repo_name=MessagePack-CSharp" data-view-component="true" class="Link--primary no-underline Link d-flex flex-items-center"> Packages <span title="0" hidden="hidden" data-view-component="true" class="Counter ml-1">0</span> </a></h2> <div class="text-small color-fg-muted" > No packages published <br> </div> </div> </div> <div class="BorderGrid-row" > <div class="BorderGrid-cell"> <h2 class="h4 mb-3"> <a href="/MessagePack-CSharp/MessagePack-CSharp/network/dependents" data-view-component="true" class="Link--primary no-underline Link"> Used by <span title="4,681" data-view-component="true" class="Counter">4.7k</span> </a> </h2> <a class="d-flex flex-items-center" href="/MessagePack-CSharp/MessagePack-CSharp/network/dependents"> <ul class="hx_flex-avatar-stack list-style-none min-width-0"> <li class="hx_flex-avatar-stack-item"> <img class="avatar avatar-user" src="https://avatars.githubusercontent.com/u/106974765?s=64&amp;v=4" width="32" height="32" alt="@wont-work" /> </li> <li class="hx_flex-avatar-stack-item"> <img class="avatar avatar-user" src="https://avatars.githubusercontent.com/u/89280149?s=64&amp;v=4" width="32" height="32" alt="@KBitLogic" /> </li> <li class="hx_flex-avatar-stack-item"> <img class="avatar" src="https://avatars.githubusercontent.com/u/165302874?s=64&amp;v=4" width="32" height="32" alt="@Architecting-ASP-NET-Core-applications" /> </li> <li class="hx_flex-avatar-stack-item"> <img class="avatar avatar-user" src="https://avatars.githubusercontent.com/u/8005097?s=64&amp;v=4" width="32" height="32" alt="@boyarovdu" /> </li> <li class="hx_flex-avatar-stack-item"> <img class="avatar avatar-user" src="https://avatars.githubusercontent.com/u/50763230?s=64&amp;v=4" width="32" height="32" alt="@AFunDog" /> </li> <li class="hx_flex-avatar-stack-item"> <img class="avatar" src="https://avatars.githubusercontent.com/u/60259440?s=64&amp;v=4" width="32" height="32" alt="@The-Tech-Idea" /> </li> <li class="hx_flex-avatar-stack-item"> <img class="avatar" src="https://avatars.githubusercontent.com/u/98072166?s=64&amp;v=4" width="32" height="32" alt="@beehexacorp" /> </li> <li class="hx_flex-avatar-stack-item"> <img class="avatar" src="https://avatars.githubusercontent.com/u/40544449?s=64&amp;v=4" width="32" height="32" alt="@MatfRS2" /> </li> </ul> <span class="px-2 text-bold text-small no-wrap"> + 4,673 </span> </a> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3"> <a href="/MessagePack-CSharp/MessagePack-CSharp/graphs/contributors" data-view-component="true" class="Link--primary no-underline Link d-flex flex-items-center"> Contributors <span title="103" data-view-component="true" class="Counter ml-1">103</span> </a></h2> <ul class="list-style-none d-flex flex-wrap mb-n2"> <li class="mb-2 mr-2" > <a href="https://github.com/AArnott" class="" data-hovercard-type="user" data-hovercard-url="/users/AArnott/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/3548?s=64&amp;v=4" alt="@AArnott" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/neuecc" class="" data-hovercard-type="user" data-hovercard-url="/users/neuecc/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/46207?s=64&amp;v=4" alt="@neuecc" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/apps/dependabot" class="" > <img src="https://avatars.githubusercontent.com/in/29110?s=64&amp;v=4" alt="@dependabot[bot]" size="32" height="32" width="32" data-view-component="true" class="avatar" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/pCYSl5EDgo" class="" data-hovercard-type="user" data-hovercard-url="/users/pCYSl5EDgo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/31692496?s=64&amp;v=4" alt="@pCYSl5EDgo" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/mayuki" class="" data-hovercard-type="user" data-hovercard-url="/users/mayuki/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/9012?s=64&amp;v=4" alt="@mayuki" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/shimat" class="" data-hovercard-type="user" data-hovercard-url="/users/shimat/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/4434824?s=64&amp;v=4" alt="@shimat" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/Alezy80" class="" data-hovercard-type="user" data-hovercard-url="/users/Alezy80/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/8435372?s=64&amp;v=4" alt="@Alezy80" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/JohannesDeml" class="" data-hovercard-type="user" data-hovercard-url="/users/JohannesDeml/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/4518980?s=64&amp;v=4" alt="@JohannesDeml" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/thorgeirk11" class="" data-hovercard-type="user" data-hovercard-url="/users/thorgeirk11/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/2693474?s=64&amp;v=4" alt="@thorgeirk11" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/davenewza" class="" data-hovercard-type="user" data-hovercard-url="/users/davenewza/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/6212830?s=64&amp;v=4" alt="@davenewza" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/lynzrand" class="" data-hovercard-type="user" data-hovercard-url="/users/lynzrand/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/10259119?s=64&amp;v=4" alt="@lynzrand" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/neofuji" class="" data-hovercard-type="user" data-hovercard-url="/users/neofuji/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/14163516?s=64&amp;v=4" alt="@neofuji" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/Alxandr" class="" data-hovercard-type="user" data-hovercard-url="/users/Alxandr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/112334?s=64&amp;v=4" alt="@Alxandr" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/icanhasjonas" class="" data-hovercard-type="user" data-hovercard-url="/users/icanhasjonas/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/719695?s=64&amp;v=4" alt="@icanhasjonas" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> </ul> <div data-view-component="true" class="mt-3"> <a text="small" href="/MessagePack-CSharp/MessagePack-CSharp/graphs/contributors" data-view-component="true" class="Link--inTextBlock Link"> + 89 contributors </a></div> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3">Languages</h2> <div class="mb-2"> <span data-view-component="true" class="Progress"> <span style="background-color:#178600 !important;;width: 98.0%;" itemprop="keywords" aria-label="C# 98.0" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> <span style="background-color:#012456 !important;;width: 1.8%;" itemprop="keywords" aria-label="PowerShell 1.8" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> <span style="background-color:#ededed !important;;width: 0.2%;" itemprop="keywords" aria-label="Other 0.2" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> </span></div> <ul class="list-style-none"> <li class="d-inline"> <a class="d-inline-flex flex-items-center flex-nowrap Link--secondary no-underline text-small mr-3" href="/MessagePack-CSharp/MessagePack-CSharp/search?l=c%23" data-ga-click="Repository, language stats search click, location:repo overview"> <svg style="color:#178600;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">C#</span> <span>98.0%</span> </a> </li> <li class="d-inline"> <a class="d-inline-flex flex-items-center flex-nowrap Link--secondary no-underline text-small mr-3" href="/MessagePack-CSharp/MessagePack-CSharp/search?l=powershell" data-ga-click="Repository, language stats search click, location:repo overview"> <svg style="color:#012456;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">PowerShell</span> <span>1.8%</span> </a> </li> <li class="d-inline"> <span class="d-inline-flex flex-items-center flex-nowrap text-small mr-3"> <svg style="color:#ededed;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">Other</span> <span>0.2%</span> </span> </li> </ul> </div> </div> </div> </div> </div></div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer pt-8 pb-6 f6 color-fg-muted p-responsive" role="contentinfo" > <h2 class='sr-only'>Footer</h2> <div class="d-flex flex-justify-center flex-items-center flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap"> <div class="d-flex flex-items-center flex-shrink-0 mx-2"> <a aria-label="Homepage" title="GitHub" class="footer-octicon mr-2" href="https://github.com"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12.5.75C6.146.75 1 5.896 1 12.25c0 5.089 3.292 9.387 7.863 10.91.575.101.79-.244.79-.546 0-.273-.014-1.178-.014-2.142-2.889.532-3.636-.704-3.866-1.35-.13-.331-.69-1.352-1.18-1.625-.402-.216-.977-.748-.014-.762.906-.014 1.553.834 1.769 1.179 1.035 1.74 2.688 1.25 3.349.948.1-.747.402-1.25.733-1.538-2.559-.287-5.232-1.279-5.232-5.678 0-1.25.445-2.285 1.178-3.09-.115-.288-.517-1.467.115-3.048 0 0 .963-.302 3.163 1.179.92-.259 1.897-.388 2.875-.388.977 0 1.955.13 2.875.388 2.2-1.495 3.162-1.179 3.162-1.179.633 1.581.23 2.76.115 3.048.733.805 1.179 1.825 1.179 3.09 0 4.413-2.688 5.39-5.247 5.678.417.36.776 1.05.776 2.128 0 1.538-.014 2.774-.014 3.162 0 .302.216.662.79.547C20.709 21.637 24 17.324 24 12.25 24 5.896 18.854.75 12.5.75Z"></path> </svg> </a> <span> &copy; 2024 GitHub,&nbsp;Inc. </span> </div> <nav aria-label="Footer"> <h3 class="sr-only" id="sr-footer-heading">Footer navigation</h3> <ul class="list-style-none d-flex flex-justify-center flex-wrap mb-2 mb-lg-0" aria-labelledby="sr-footer-heading"> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to Terms&quot;,&quot;label&quot;:&quot;text:terms&quot;}" href="https://docs.github.com/site-policy/github-terms/github-terms-of-service" data-view-component="true" class="Link--secondary Link">Terms</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to privacy&quot;,&quot;label&quot;:&quot;text:privacy&quot;}" href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" data-view-component="true" class="Link--secondary Link">Privacy</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to security&quot;,&quot;label&quot;:&quot;text:security&quot;}" href="https://github.com/security" data-view-component="true" class="Link--secondary Link">Security</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to status&quot;,&quot;label&quot;:&quot;text:status&quot;}" href="https://www.githubstatus.com/" data-view-component="true" class="Link--secondary Link">Status</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to docs&quot;,&quot;label&quot;:&quot;text:docs&quot;}" href="https://docs.github.com/" data-view-component="true" class="Link--secondary Link">Docs</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to contact&quot;,&quot;label&quot;:&quot;text:contact&quot;}" href="https://support.github.com?tags=dotcom-footer" data-view-component="true" class="Link--secondary Link">Contact</a> </li> <li class="mx-2" > <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;cookies&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;cookies_link_subfooter_footer&quot;}" > Manage cookies </button> </cookie-consent-link> </li> <li class="mx-2"> <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;dont_share_info&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;dont_share_info_link_subfooter_footer&quot;}" > Do not share my personal information </button> </cookie-consent-link> </li> </ul> </nav> </div> </footer> <ghcc-consent id="ghcc" class="position-fixed bottom-0 left-0" style="z-index: 999999" data-initial-cookie-consent-allowed="" data-cookie-consent-required="false"></ghcc-consent> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> You can’t perform that action at this time. </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details> </template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div> </div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> <template id="snippet-clipboard-copy-button-unpositioned"> <div class="zeroclipboard-container"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> </div> <div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div> <div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10