A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://dotnet.github.io/dotNext/api/DotNext.IO.Pipelines.PipeExtensions.html below:

Class PipeExtensions | .NEXT

Class PipeExtensions

Represents extension method for parsing data stored in pipe.

Inheritance

PipeExtensions

Namespace: DotNext.IO.Pipelines Assembly: DotNext.IO.dll Syntax
public static class PipeExtensions
Methods | Edit this page View Source CopyFromAsync(PipeWriter, Stream, long, CancellationToken)

Copies the specified number of bytes from source stream.

Declaration
public static ValueTask CopyFromAsync(this PipeWriter destination, Stream source, long count, CancellationToken token = default)
Parameters Type Name Description PipeWriter destination

The pipe to write into.

Stream source

The source stream.

long count

The number of bytes to be copied.

CancellationToken token

The token that can be used to cancel the operation.

Returns Type Description ValueTask

The task representing asynchronous execution of this method.

Exceptions | Edit this page View Source CopyToAsync<TConsumer>(PipeReader, TConsumer, long, CancellationToken)

Reads the entire content using the specified consumer.

Declaration
public static ValueTask CopyToAsync<TConsumer>(this PipeReader reader, TConsumer consumer, long count, CancellationToken token = default) where TConsumer : ISupplier<ReadOnlyMemory<byte>, CancellationToken, ValueTask>
Parameters Type Name Description PipeReader reader

The pipe to read from.

TConsumer consumer

The content reader.

long count

The number of bytes to copy.

CancellationToken token

The token that can be used to cancel operation.

Returns Type Description ValueTask

The task representing asynchronous execution of this method.

Type Parameters Name Description TConsumer

The type of the consumer.

Exceptions | Edit this page View Source CopyToAsync<TConsumer>(PipeReader, TConsumer, CancellationToken)

Reads the entire content using the specified consumer.

Declaration
public static ValueTask CopyToAsync<TConsumer>(this PipeReader reader, TConsumer consumer, CancellationToken token = default) where TConsumer : ISupplier<ReadOnlyMemory<byte>, CancellationToken, ValueTask>
Parameters Type Name Description PipeReader reader

The pipe to read from.

TConsumer consumer

The content reader.

CancellationToken token

The token that can be used to cancel operation.

Returns Type Description ValueTask

The task representing asynchronous execution of this method.

Type Parameters Name Description TConsumer

The type of the consumer.

Exceptions | Edit this page View Source DecodeAsync(PipeReader, DecodingContext, LengthFormat, MemoryAllocator<char>?, CancellationToken)

Decodes string asynchronously from pipe.

Declaration
public static ValueTask<MemoryOwner<char>> DecodeAsync(this PipeReader reader, DecodingContext context, LengthFormat lengthFormat, MemoryAllocator<char>? allocator = null, CancellationToken token = default)
Parameters Returns Exceptions | Edit this page View Source DecodeAsync(PipeReader, DecodingContext, LengthFormat, Memory<char>, CancellationToken)

Decodes the sequence of characters.

Declaration
public static IAsyncEnumerable<ReadOnlyMemory<char>> DecodeAsync(this PipeReader reader, DecodingContext context, LengthFormat lengthFormat, Memory<char> buffer, CancellationToken token = default)
Parameters Type Name Description PipeReader reader

The pipe reader.

DecodingContext context

The decoding context containing string characters encoding.

LengthFormat lengthFormat

The format of the string length encoded in the stream.

Memory<char> buffer

The buffer of characters.

CancellationToken token

The token that can be used to cancel the operation.

Returns Exceptions | Edit this page View Source ParseAsync<T>(PipeReader, LengthFormat, NumberStyles, IFormatProvider?, CancellationToken)

Parses the numeric value from UTF-8 encoded characters.

Declaration
public static ValueTask<T> ParseAsync<T>(this PipeReader reader, LengthFormat lengthFormat, NumberStyles style, IFormatProvider? provider = null, CancellationToken token = default) where T : INumberBase<T>
Parameters Type Name Description PipeReader reader

The pipe reader.

LengthFormat lengthFormat

The format of the string length (in bytes) encoded in the stream.

NumberStyles style

A combination of number styles.

IFormatProvider provider

Culture-specific formatting information.

CancellationToken token

The token that can be used to cancel the operation.

Returns Type Description ValueTask<T>

The result of parsing.

Type Parameters Name Description T

The numeric type.

Exceptions | Edit this page View Source ParseAsync<T>(PipeReader, LengthFormat, IFormatProvider?, CancellationToken)

Parses the sequence of characters encoded as UTF-8.

Declaration
public static ValueTask<T> ParseAsync<T>(this PipeReader reader, LengthFormat lengthFormat, IFormatProvider? provider = null, CancellationToken token = default) where T : IUtf8SpanParsable<T>
Parameters Type Name Description PipeReader reader

The pipe reader.

LengthFormat lengthFormat

The format of the string length (in bytes) encoded in the stream.

IFormatProvider provider

Culture-specific formatting information.

CancellationToken token

The token that can be used to cancel the operation.

Returns Type Description ValueTask<T>

The result of parsing.

Type Parameters Name Description T

The type that supports parsing from UTF-8.

Exceptions | Edit this page View Source ParseAsync<TArg, TResult>(PipeReader, TArg, ReadOnlySpanFunc<char, TArg, TResult>, DecodingContext, LengthFormat, MemoryAllocator<char>?, CancellationToken)

Parses the sequence of characters.

Declaration
public static ValueTask<TResult> ParseAsync<TArg, TResult>(this PipeReader reader, TArg arg, ReadOnlySpanFunc<char, TArg, TResult> parser, DecodingContext context, LengthFormat lengthFormat, MemoryAllocator<char>? allocator = null, CancellationToken token = default)
Parameters Type Name Description PipeReader reader

The pipe reader.

TArg arg

The argument to be passed to parser.

ReadOnlySpanFunc<char, TArg, TResult> parser

The parser of characters.

DecodingContext context

The decoding context containing string characters encoding.

LengthFormat lengthFormat

The format of the string length (in bytes) encoded in the stream.

MemoryAllocator<char> allocator

The allocator of internal buffer.

CancellationToken token

The token that can be used to cancel the operation.

Returns Type Description ValueTask<TResult>

The parsed value.

Type Parameters Name Description TArg

The type of the argument to be passed to parser.

TResult

The type of the result.

Exceptions | Edit this page View Source ReadAllAsync(PipeReader, CancellationToken)

Reads all chunks of data from the pipe.

Declaration
public static IAsyncEnumerable<ReadOnlyMemory<byte>> ReadAllAsync(this PipeReader reader, CancellationToken token = default)
Parameters Returns Exceptions | Edit this page View Source ReadAsync(PipeReader, LengthFormat, MemoryAllocator<byte>?, CancellationToken)

Reads length-prefixed block of bytes.

Declaration
public static ValueTask<MemoryOwner<byte>> ReadAsync(this PipeReader reader, LengthFormat lengthFormat, MemoryAllocator<byte>? allocator = null, CancellationToken token = default)
Parameters Type Name Description PipeReader reader

The pipe reader.

LengthFormat lengthFormat

The format of the block length encoded in the underlying pipe.

MemoryAllocator<byte> allocator

The memory allocator used to place the decoded block of bytes.

CancellationToken token

The token that can be used to cancel the operation.

Returns Exceptions | Edit this page View Source ReadAsync(PipeReader, Memory<byte>, CancellationToken)

Reads the block of memory.

Declaration
public static ValueTask<int> ReadAsync(this PipeReader reader, Memory<byte> output, CancellationToken token = default)
Parameters Type Name Description PipeReader reader

The pipe reader.

Memory<byte> output

The block of memory to fill from the pipe.

CancellationToken token

The token that can be used to cancel operation.

Returns Type Description ValueTask<int>

The actual number of copied bytes.

| Edit this page View Source ReadAsync<T>(PipeReader, CancellationToken)

Decodes the value of binary formattable type.

Declaration
public static ValueTask<T> ReadAsync<T>(this PipeReader reader, CancellationToken token = default) where T : IBinaryFormattable<T>
Parameters Returns Type Description ValueTask<T>

The decoded value.

Type Parameters Name Description T

The type of the result.

Exceptions | Edit this page View Source ReadAtLeastAsync(PipeReader, Memory<byte>, int, CancellationToken)

Reads at least the specified number of bytes.

Declaration
public static ValueTask<int> ReadAtLeastAsync(this PipeReader reader, Memory<byte> destination, int minimumSize, CancellationToken token)
Parameters Type Name Description PipeReader reader

The pipe reader.

Memory<byte> destination

The buffer to write into.

int minimumSize

The minimum number of bytes to read.

CancellationToken token

The token that can be used to cancel operation.

Returns Type Description ValueTask<int>

The actual number of bytes written to destination.

Exceptions | Edit this page View Source ReadBigEndianAsync<T>(PipeReader, CancellationToken)

Reads integer encoded in big-endian format.

Declaration
public static ValueTask<T> ReadBigEndianAsync<T>(this PipeReader reader, CancellationToken token = default) where T : IBinaryInteger<T>
Parameters Returns Type Description ValueTask<T>

The integer value.

Type Parameters Name Description T

The integer type.

Exceptions | Edit this page View Source ReadExactlyAsync(PipeReader, long, CancellationToken)

Reads exactly the specified amount of bytes as a sequence of chunks.

Declaration
public static IAsyncEnumerable<ReadOnlyMemory<byte>> ReadExactlyAsync(this PipeReader reader, long length, CancellationToken token = default)
Parameters Type Name Description PipeReader reader

The pipe reader.

long length

The numbers of bytes to read.

CancellationToken token

The token that can be used to cancel the operation.

Returns Exceptions | Edit this page View Source ReadExactlyAsync(PipeReader, Memory<byte>, CancellationToken)

Reads the block of memory.

Declaration
public static ValueTask ReadExactlyAsync(this PipeReader reader, Memory<byte> output, CancellationToken token = default)
Parameters Type Name Description PipeReader reader

The pipe reader.

Memory<byte> output

The block of memory to fill from the pipe.

CancellationToken token

The token that can be used to cancel operation.

Returns Type Description ValueTask

The task representing asynchronous state of the operation.

Exceptions | Edit this page View Source ReadLittleEndianAsync<T>(PipeReader, CancellationToken)

Reads integer encoded in little-endian format.

Declaration
public static ValueTask<T> ReadLittleEndianAsync<T>(this PipeReader reader, CancellationToken token = default) where T : IBinaryInteger<T>
Parameters Returns Type Description ValueTask<T>

The integer value.

Type Parameters Name Description T

The integer type.

Exceptions | Edit this page View Source ReadUtf8Async(PipeReader, IBufferWriter<char>, CancellationToken)

Decodes null-terminated UTF-8 encoded string.

Declaration
public static ValueTask ReadUtf8Async(this PipeReader reader, IBufferWriter<char> output, CancellationToken token = default)
Parameters Returns Type Description ValueTask

The task representing asynchronous execution of this method.

Exceptions | Edit this page View Source SkipAsync(PipeReader, long, CancellationToken)

Drops the specified number of bytes from the pipe.

Declaration
public static ValueTask SkipAsync(this PipeReader reader, long length, CancellationToken token = default)
Parameters Type Name Description PipeReader reader

The pipe reader.

long length

The number of bytes to skip.

CancellationToken token

The token that can be used to cancel the operation.

Returns Type Description ValueTask

The task representing asynchronous execution of this method.

Exceptions | Edit this page View Source TryReadExactly(PipeReader, long, out ReadResult)

Attempts to read block of data synchronously.

Declaration
public static bool TryReadExactly(this PipeReader reader, long length, out ReadResult result)
Parameters Type Name Description PipeReader reader

The pipe reader.

long length

The length of the block to consume, in bytes.

ReadResult result

The requested block of data which length is equal to length in case of success; otherwise, empty block.

Returns Type Description bool

true if the block of requested length is obtained successfully; otherwise, false.

| Edit this page View Source WriteAsync(PipeWriter, ReadOnlySequence<byte>, CancellationToken)

Writes sequence of bytes to the underlying stream asynchronously.

Declaration
public static ValueTask WriteAsync(this PipeWriter writer, ReadOnlySequence<byte> sequence, CancellationToken token = default)
Parameters Returns Type Description ValueTask

The task representing asynchronous execution of this method.

Exceptions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4