Show / Hide Table of Contents

Struct StreamConsumer

Represents implementation of IConsumer<T> in the form of the writer to Stream.

Implements
IConsumer<ReadOnlySpan<byte>>
ISupplier<ReadOnlyMemory<byte>, CancellationToken, ValueTask>
IFunctional
IFlushable
IEquatable<StreamConsumer>
Inherited Members
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: DotNext.IO
Assembly: DotNext.dll
Syntax
public readonly struct StreamConsumer : IConsumer<ReadOnlySpan<byte>>, ISupplier<ReadOnlyMemory<byte>, CancellationToken, ValueTask>, IFunctional, IFlushable, IEquatable<StreamConsumer>

Constructors

View Source

StreamConsumer(Stream)

Represents implementation of IConsumer<T> in the form of the writer to Stream.

Declaration
public StreamConsumer(Stream output)
Parameters
Type Name Description
Stream output

The writable stream.

Properties

View Source

IsEmpty

Gets a value indicating that the underlying stream is null.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
bool

Methods

View Source

Deconstruct(out Stream)

Declaration
public void Deconstruct(out Stream output)
Parameters
Type Name Description
Stream output
View Source

Equals(StreamConsumer)

Declaration
public bool Equals(StreamConsumer other)
Parameters
Type Name Description
StreamConsumer other
Returns
Type Description
bool
View Source

Equals(object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
ValueType.Equals(object)
View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
ValueType.GetHashCode()
View Source

ToString()

Returns a string that represents the underlying stream.

Declaration
public override string? ToString()
Returns
Type Description
string

A string that represents the underlying stream.

Overrides
ValueType.ToString()

Operators

View Source

operator ==(StreamConsumer, StreamConsumer)

Declaration
public static bool operator ==(StreamConsumer left, StreamConsumer right)
Parameters
Type Name Description
StreamConsumer left
StreamConsumer right
Returns
Type Description
bool
View Source

implicit operator StreamConsumer(Stream)

Wraps the stream.

Declaration
public static implicit operator StreamConsumer(Stream output)
Parameters
Type Name Description
Stream output

The writable stream.

Returns
Type Description
StreamConsumer

The wrapped stream.

Exceptions
Type Condition
ArgumentNullException

output is null.

View Source

operator !=(StreamConsumer, StreamConsumer)

Declaration
public static bool operator !=(StreamConsumer left, StreamConsumer right)
Parameters
Type Name Description
StreamConsumer left
StreamConsumer right
Returns
Type Description
bool

Implements

IConsumer<T>
ISupplier<T1, T2, TResult>
IFunctional
IFlushable
IEquatable<T>

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾