#MemoryStream
Found a neat way of creating `BinaryData` from a `MemoryStream` with a zero-copy operation:

```
var stream = new MemoryStream();
stream.Write([1, 2, 3]); // some data is written to the memory stream
stream.Flush();

// this requires a memory copy
var […]

[Original post on hachyderm.io]
October 23, 2025 at 10:48 AM
また前後の PerSecondDataの位置をもつ両方向リンクリスト構造なので、(FrameDataが可変長であるにもかかわらず) リプレイ再生の早送り・巻き戻しができます (ただし1秒単位)。

【最後に zlib圧縮】
このようなバイト列 (MemoryStream) を、ファイルに保存するときは zlib で圧縮してから Base64 で文字化しています。
すると、データサイズはおよそ
《 1機 10分で 100 KB 》
となりました。

ブルーインパルスのフル再現を想定して 6機 45分 としても、たったの 2.7 MB です。
July 10, 2026 at 5:31 AM
HttpContent.ReadAsStream (in .Net) copies content into a memorystream (buffered in memory). That's why you can still read the stream while the original HttpContent is already out of scope.
In my opinion this is a hack. I'd rather have a solution that works with properly scoping the variables.
February 24, 2025 at 4:05 PM
お ま た せ
い つ も の

(解説: C# でプログラミングをする時に「ここはまだ実装してないよ!!だからここのコードを実際に実行したらエラー出すね」というのを示すのが NotImplementedException です)
July 28, 2023 at 12:39 PM
Full working decompress code (but Unity 2022.3.x and not Unity 6 so ymmv):

MemoryStream src = new MemoryStream(content);
GZipStream zip = new GZipStream(src, CompressionMode.Decompress);
MemoryStream result = new MemoryStream(2 * content.Length);
zip.CopyTo(result);
zip.Close();
src.Close();
May 24, 2025 at 3:42 AM
Compress and decompress, but with streams in both directions:
GZipStream zipStream = new GZipStream(resultStream, CompressionMode.Compress);
and
GZipStream zipStream = new GZipStream(sourceStream, CompressionMode.Decompress);

streams are MemoryStream in both cases.
May 24, 2025 at 3:25 AM
I have not written specifically about dotnet for a few months. This is the last one blog.markoliver.website/Memory-Mappe...
December 1, 2024 at 9:50 AM
new BitmapImage(new Uri(Uri)); ってすると、NotSupportedExceptionが発生してもファイル開きっぱなしになってて困ってた

MemoryStream -> WriteableBitmap でなんとかなった
October 27, 2024 at 8:14 AM
e o filho da puta do memorystream q diz q está fechado apesar de eu estar a ver q está aberto até ao momento q o estou a usar.
May 22, 2025 at 1:09 PM
May 22, 2025 at 8:03 PM
Não tô acreditando que 20 anos depois de começar a programar em C# descobri que dá pra acessar o buffer interno do MemoryStream sem fazer cópia dele. Que raiva só ter descoberto agora, aff.
February 28, 2025 at 9:25 PM
WatsonWebserver v7.1.0 HTTP/1 Chunked Request Processing Bypasses MaxRequestBodySize

Posted by Ron E on Aug 26WatsonWebserver contains an HTTP/1 request body size-limit bypass when
processing requests using Transfer-Encoding: chunked.

The framework's configured Settings.IO.Max…
#hackernews #news
WatsonWebserver v7.1.0 HTTP/1 Chunked Request Processing Bypasses MaxRequestBodySize
Posted by Ron E on Aug 26WatsonWebserver contains an HTTP/1 request body size-limit bypass when processing requests using Transfer-Encoding: chunked. The framework's configured Settings.IO.MaxRequestBodySize limit is enforced when a request declares its body size using Content-Length. However, requests using chunked transfer encoding are processed through a separate body-reading path that accumulates decoded chunks into a MemoryStream without enforcing the same...
seclists.org
August 27, 2026 at 1:18 PM
KZDev.PerfUtils v3 is out 🚀 MemoryStreamSlim (drop-in for MemoryStream) now includes ToMemory() for more memory-efficient raw buffer access, and is benchmarked ahead of RecyclableMemoryStream across all categories.
www.nuget.org/packages/KZD...
#dotnet #csharp #perf #opensource
KZDev.PerfUtils 3.0.1
Performance utilities for .NET projects, including the MemoryStreamSlim, StringBuilderCache, InterlockedOps, and Compression classes.
www.nuget.org
April 17, 2026 at 1:46 PM
📊 Benchmarks:
See side-by-side comparisons with MemoryStream and RecyclableMemoryStream.
kzdev-net.github.io/kzdev.perfut...
MemoryStream Benchmarks | KZDev.PerfUtils
kzdev-net.github.io
May 29, 2025 at 9:30 AM
🚀 Announcing MemoryStreamSlim
A fast, secure drop-in for .NET's MemoryStream
✅ Outperforms RecyclableMemoryStream
✅ Clears unused memory
✅ Native memory support
📦 NuGet: www.nuget.org/packages/KZD...
#dotnet #csharp #performance #NuGet #GC
KZDev.PerfUtils 2.0.1
Performance utilities for .NET projects, including the MemoryStreamSlim, StringBuilderCache, InterlockedOps, and Compression classes.
www.nuget.org
May 29, 2025 at 9:26 AM