StreamSource
Represents Stream factory methods.
public static Stream AsAsynchronousStream<TOutput>(TOutput output) where TOutput : ISupplier<ReadOnlyMemory<byte>, CancellationToken, ValueTask>, IFlushable
Returns writable asynchronous stream.
Converts segment of an array to the stream.
Converts read-only sequence of bytes to a read-only stream.
Converts read-only memory to a read-only stream.
public static Stream AsStream<TArg>(this ReadOnlySpanAction<byte, TArg> writer, TArg arg, Action<TArg> flush = null, Func<TArg, CancellationToken, Task> flushAsync = null)
Returns writable stream that wraps the provided delegate for writing data.
public static Stream AsStream<TWriter>(this TWriter writer, Action<TWriter> flush = null, Func<TWriter, CancellationToken, Task> flushAsync = null) where TWriter : IBufferWriter<byte>
Returns writable stream associated with the buffer writer.
Creates a stream over sparse memory.
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)
Returns writable stream that wraps the provided delegate for writing data.
public static Stream AsStream<TArg>(this Func<Memory<byte>, TArg, CancellationToken, ValueTask<int>> reader, TArg arg)
Returns read-only asynchronous stream that wraps the provided delegate for reading data.
public static Stream AsSynchronousStream<TOutput>(TOutput output) where TOutput : IFlushable, IReadOnlySpanConsumer<byte>
Returns writable synchronous stream.