<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.1.25080.3" />

StreamExtensions

static class StreamExtensions
using System.Runtime.CompilerServices; using Windows.Win32; using Windows.Win32.Foundation; using Windows.Win32.System.Com; namespace System.IO { internal static class StreamExtensions { internal static ComScope<IStream> ToIStream([Nullable(1)] this Stream stream, bool makeSeekable = false) { ArgumentNullException.ThrowIfNull(stream, "stream"); return ComHelpers.GetComScope<IStream>(new ComManagedStream(stream, makeSeekable)); } } }