![]() |
VOOZH | about |
dotnet add package System.Memory.Data --version 10.0.9
NuGet\Install-Package System.Memory.Data -Version 10.0.9
<PackageReference Include="System.Memory.Data" Version="10.0.9" />
<PackageVersion Include="System.Memory.Data" Version="10.0.9" />Directory.Packages.props
<PackageReference Include="System.Memory.Data" />Project file
paket add System.Memory.Data --version 10.0.9
#r "nuget: System.Memory.Data, 10.0.9"
#:package System.Memory.Data@10.0.9
#addin nuget:?package=System.Memory.Data&version=10.0.9Install as a Cake Addin
#tool nuget:?package=System.Memory.Data&version=10.0.9Install as a Cake Tool
System.Memory.Data introduces the BinaryData type, a lightweight abstraction for a byte payload.
It makes it easy to convert between string, bytes, and stream.
This abstraction can simplify the API surface by exposing a single type instead of numerous overloads or properties.
The BinaryData type handles data ownership efficiently, wrapping passed-in bytes when using byte[] or ReadOnlyMemory<byte> constructors or methods, and managing data as bytes when dealing with streams, strings, or rich model types serialized as JSON.
BinaryData type.To/From String:
var data = new BinaryData("some data");
// ToString will decode the bytes using UTF-8
Console.WriteLine(data.ToString()); // prints "some data"
To/From Bytes:
byte[] bytes = Encoding.UTF8.GetBytes("some data");
// Create BinaryData using a constructor ...
BinaryData data = new BinaryData(bytes);
// Or using a static factory method.
data = BinaryData.FromBytes(bytes);
// There is an implicit cast defined for ReadOnlyMemory<byte>
ReadOnlyMemory<byte> rom = data;
// There is also an implicit cast defined for ReadOnlySpan<byte>
ReadOnlySpan<byte> ros = data;
// there is also a ToMemory method that gives access to the ReadOnlyMemory.
rom = data.ToMemory();
// and a ToArray method that converts into a byte array.
byte[] array = data.ToArray();
To/From stream:
var bytes = Encoding.UTF8.GetBytes("some data");
Stream stream = new MemoryStream(bytes);
var data = BinaryData.FromStream(stream);
// Calling ToStream will give back a stream that is backed by ReadOnlyMemory, so it is not writable.
stream = data.ToStream();
Console.WriteLine(stream.CanWrite); // prints false
BinaryData also can be used to integrate with ObjectSerializer.
By default, the JsonObjectSerializer will be used, but any serializer deriving from ObjectSerializer can be used.
var model = new CustomModel
{
A = "some text",
B = 5,
C = true
};
var data = BinaryData.FromObjectAsJson(model);
model = data.ToObjectFromJson<CustomModel>();
The main types provided by this library are:
System.BinaryDataSystem.Memory.Data is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on System.Memory.Data:
| Package | Downloads |
|---|---|
|
Azure.Core
This is the implementation of the Azure Client Pipeline |
|
|
System.ClientModel
Contains building blocks for clients that call cloud services. |
|
|
Microsoft.Azure.WebJobs
This package contains the runtime host components of the WebJobs SDK. For more information, please visit https://go.microsoft.com/fwlink/?linkid=2279708. |
|
|
Microsoft.Azure.WebJobs.Core
This package provides the core Types and Attribute definitions for the WebJobs SDK. For more information, please visit https://go.microsoft.com/fwlink/?linkid=2279708. |
|
|
Azure.Core.Amqp
This library contains AMQP model types used by Azure libraries. |
Showing the top 20 popular GitHub repositories that depend on System.Memory.Data:
| Repository | Stars |
|---|---|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
dotnet/orleans
Cloud Native application framework for .NET
|
|
|
Azure/azure-sdk-for-net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
|
|
|
dotnet/skills
Repository for skills to assist AI coding agents with .NET and C#
|
|
|
dotnet/extensions
This repository contains a suite of libraries that provide facilities commonly needed when creating production-ready applications.
|
|
|
SciSharp/BotSharp
AI Multi-Agent Framework in .NET
|
|
|
netwrix/pingcastle
PingCastle - Get Active Directory Security at 80% in 20% of the time
|
|
|
roslynpad/roslynpad
A cross-platform C# editor based on Roslyn and AvalonEdit
|
|
|
microsoft/kernel-memory
Research project. A Memory solution for users, teams, and applications.
|
|
|
smartstore/Smartstore
A modular, scalable and ultra-fast open-source all-in-one eCommerce platform built on ASP.NET Core 10
|
|
|
MarimerLLC/csla
A home for your business logic in any .NET application.
|
|
|
tryAGI/LangChain
C# implementation of LangChain. We try to be as close to the original as possible in terms of abstractions, but are open to new entities.
|
|
|
DaxStudio/DaxStudio
DAX Studio is a tool to write, execute, and analyze DAX queries in Power BI Desktop, Power Pivot for Excel, and Analysis Services Tabular.
|
|
|
doghappy/socket.io-client-csharp
socket.io-client implemention for .NET
|
|
|
microsoft/PowerBI-CSharp
Welcome to the .NET developer community for Power BI. Here you will find resources for the .NET SDKs for Power BI Embedded V2.0.0
|
|
|
Azure/azure-webjobs-sdk
Azure WebJobs SDK
|
|
|
Kyrodan/KeeAnywhere
A cloud storage provider plugin for KeePass Password Safe
|
|
|
SparkDevNetwork/Rock
An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
|
|
|
Avanade/Liquid-Application-Framework
Liquid Application Framework documentation, useful links and sample project
|
|
|
microsoft/SqlNexus
SQL Nexus is a tool that helps you identify the root cause of SQL Server performance issues. It loads and analyzes performance data collected by SQL LogScout, SQLDiag or PSSDiag. It can dramatically reduce the amount of time you spend manually analyzing data.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.5.26302.115 | 482 | 6/9/2026 |
| 11.0.0-preview.4.26230.115 | 1,516 | 5/12/2026 |
| 11.0.0-preview.3.26207.106 | 2,105 | 4/14/2026 |
| 11.0.0-preview.2.26159.112 | 2,018 | 3/10/2026 |
| 11.0.0-preview.1.26104.118 | 2,421 | 2/10/2026 |
| 10.0.9 | 72,451 | 6/9/2026 |
| 10.0.8 | 338,216 | 5/12/2026 |
| 10.0.7 | 497,126 | 4/21/2026 |
| 10.0.6 | 155,832 | 4/14/2026 |
| 10.0.5 | 545,652 | 3/12/2026 |
| 10.0.4 | 74,748 | 3/10/2026 |
| 10.0.3 | 18,170,839 | 2/10/2026 |
| 10.0.2 | 746,579 | 1/13/2026 |
| 10.0.1 | 17,175,801 | 12/9/2025 |
| 9.0.17 | 1,093 | 6/9/2026 |
| 9.0.16 | 22,813 | 5/12/2026 |
| 9.0.15 | 54,043 | 4/14/2026 |
| 9.0.14 | 39,395 | 3/10/2026 |
| 9.0.13 | 58,147 | 2/10/2026 |
| 9.0.12 | 88,862 | 1/13/2026 |