DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.13.0" />

 StreamSource

public static class StreamSource
public static Stream AsAsynchronousStream<TOutput>(TOutput output) where TOutput : ISupplier<ReadOnlyMemory<byte>, CancellationToken, ValueTask>, IFlushable

public static Stream AsSharedStream(this ReadOnlySequence<byte> sequence, bool compatWithAsync = true)

public static Stream AsStream(this ArraySegment<byte> segment, bool writable = false)

public static Stream AsStream(this ReadOnlySequence<byte> sequence)

public static Stream AsStream(this ReadOnlyMemory<byte> memory)

public static Stream AsStream<TArg>(this ReadOnlySpanAction<byte, TArg> writer, TArg arg, Action<TArg> flush = null, Func<TArg, CancellationToken, Task> flushAsync = null)

public static Stream AsStream<TWriter>(this TWriter writer, Action<TWriter> flush = null, Func<TWriter, CancellationToken, Task> flushAsync = null) where TWriter : IBufferWriter<byte>

public static Stream AsStream(this SparseBufferWriter<byte> writer, bool readable)

public static Stream AsStream<TArg>(this Func<ReadOnlyMemory<byte>, TArg, CancellationToken, ValueTask> writer, TArg arg, Action<TArg> flush = null, Func<TArg, CancellationToken, Task> flushAsync = null)

public static Stream AsStream<TArg>(this Func<Memory<byte>, TArg, CancellationToken, ValueTask<int>> reader, TArg arg)

public static Stream AsSynchronousStream<TOutput>(TOutput output) where TOutput : IFlushable, IReadOnlySpanConsumer<byte>