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.SequenceReader.html below:

Struct SequenceReader | .NEXT

Struct SequenceReader

Represents binary reader for the sequence of bytes.

Namespace: DotNext.IO Assembly: DotNext.IO.dll Syntax
public struct SequenceReader : IAsyncBinaryReader, IResettable
Constructors | Edit this page View Source SequenceReader(ReadOnlySequence<byte>)

Represents binary reader for the sequence of bytes.

Declaration
public SequenceReader(ReadOnlySequence<byte> sequence)
Parameters See Also Properties | Edit this page View Source IsEmpty

Indicates that the current reader has no more data to read.

Declaration
public readonly bool IsEmpty { get; }
Property Value | Edit this page View Source Position

Gets position in the underlying sequence.

Declaration
public readonly SequencePosition Position { get; }
Property Value | Edit this page View Source RemainingSequence

Gets unread part of the sequence.

Declaration
public readonly ReadOnlySequence<byte> RemainingSequence { get; }
Property Value Methods | Edit this page View Source Decode(in DecodingContext, LengthFormat, MemoryAllocator<char>?)

Decodes a block of characters.

Declaration
public MemoryOwner<char> Decode(in DecodingContext context, LengthFormat lengthFormat, MemoryAllocator<char>? allocator = null)
Parameters Type Name Description DecodingContext context

The decoding context containing string characters encoding.

LengthFormat lengthFormat

The format of the string length encoded in the stream.

MemoryAllocator<char> allocator

The allocator of the buffer of characters.

Returns Exceptions Type Condition EndOfStreamException

The underlying source doesn't contain necessary amount of bytes to decode the value.

| Edit this page View Source Decode(in DecodingContext, LengthFormat, Memory<char>)

Decodes the sequence of characters.

Declaration
public SequenceReader.DecodingEnumerable Decode(in DecodingContext context, LengthFormat lengthFormat, Memory<char> buffer)
Parameters Type Name Description 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.

Returns Exceptions | Edit this page View Source Decode(in DecodingContext, LengthFormat, Span<char>)

Decodes the sequence of characters.

Declaration
public SequenceReader.SpanDecodingEnumerable Decode(in DecodingContext context, LengthFormat lengthFormat, Span<char> buffer)
Parameters Type Name Description DecodingContext context

The decoding context containing string characters encoding.

LengthFormat lengthFormat

The format of the string length encoded in the stream.

Span<char> buffer

The buffer of characters.

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

Parses the numeric value from UTF-8 encoded characters.

Declaration
public T Parse<T>(LengthFormat lengthFormat, NumberStyles style, IFormatProvider? provider = null) where T : INumberBase<T>
Parameters Type Name Description 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.

Returns Type Description T

The result of parsing.

Type Parameters Name Description T

The numeric type.

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

Parses the sequence of characters encoded as UTF-8.

Declaration
public T Parse<T>(LengthFormat lengthFormat, IFormatProvider? provider = null) where T : IUtf8SpanParsable<T>
Parameters Type Name Description LengthFormat lengthFormat

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

IFormatProvider provider

Culture-specific formatting information.

Returns Type Description T

The result of parsing.

Type Parameters Name Description T

The type that supports parsing from UTF-8.

Exceptions | Edit this page View Source Parse<T>(in DecodingContext, LengthFormat, NumberStyles, IFormatProvider?, MemoryAllocator<char>?)

Parses the numeric value.

Declaration
public T Parse<T>(in DecodingContext context, LengthFormat lengthFormat, NumberStyles style, IFormatProvider? provider = null, MemoryAllocator<char>? allocator = null) where T : INumberBase<T>
Parameters Type Name Description DecodingContext context

The decoding context containing string characters encoding.

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.

MemoryAllocator<char> allocator

The allocator of internal buffer.

Returns Type Description T

The result of parsing.

Type Parameters Name Description T

The numeric type.

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

Parses a block of characters.

Declaration
public TResult Parse<TArg, TResult>(TArg arg, ReadOnlySpanFunc<char, TArg, TResult> parser, in DecodingContext context, LengthFormat lengthFormat, MemoryAllocator<char>? allocator = null)
Parameters Type Name Description TArg arg

The argument to be passed to parser.

ReadOnlySpanFunc<char, TArg, TResult> parser

The parser.

DecodingContext context

The decoding context containing string characters encoding.

LengthFormat lengthFormat

The format of the string length encoded in the stream.

MemoryAllocator<char> allocator

The allocator of the buffer of characters.

Returns Type Description TResult

The parsed block of characters.

Type Parameters Name Description TArg

The type of the argument to be passed to parser.

TResult

The type of the parsing result.

Exceptions | Edit this page View Source Read(long)

Reads the specified number of bytes.

Declaration
public ReadOnlySequence<byte> Read(long count)
Parameters Type Name Description long count

The number of bytes to read.

Returns Exceptions | Edit this page View Source Read(Span<byte>)

Copies the bytes from the sequence into contiguous block of memory.

Declaration
public void Read(Span<byte> output)
Parameters Type Name Description Span<byte> output

The block of memory to fill.

Exceptions | Edit this page View Source ReadBigEndian<T>()

Reads integer encoded in big-endian format.

Declaration
public T ReadBigEndian<T>() where T : IBinaryInteger<T>
Returns Type Description T

The integer value.

Type Parameters Name Description T

The integer type.

Exceptions Type Condition EndOfStreamException

The underlying source doesn't contain necessary amount of bytes to decode the value.

| Edit this page View Source ReadBlock(LengthFormat)

Reads length-prefixed block of bytes.

Declaration
public ReadOnlySequence<byte> ReadBlock(LengthFormat lengthFormat)
Parameters Type Name Description LengthFormat lengthFormat

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

Returns Exceptions | Edit this page View Source ReadBlock(LengthFormat, MemoryAllocator<byte>?)

Reads length-prefixed block of bytes.

Declaration
public MemoryOwner<byte> ReadBlock(LengthFormat lengthFormat, MemoryAllocator<byte>? allocator)
Parameters Type Name Description LengthFormat lengthFormat

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

MemoryAllocator<byte> allocator

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

Returns Exceptions | Edit this page View Source ReadByte()

Reads single byte.

Declaration Returns Type Description byte

A byte.

Exceptions | Edit this page View Source ReadLittleEndian<T>()

Reads integer encoded in little-endian format.

Declaration
public T ReadLittleEndian<T>() where T : IBinaryInteger<T>
Returns Type Description T

The integer value.

Type Parameters Name Description T

The integer type.

Exceptions Type Condition EndOfStreamException

The underlying source doesn't contain necessary amount of bytes to decode the value.

| Edit this page View Source ReadToEnd()

Gets unread part of the buffer and advances the current reader to the end of the buffer.

Declaration
public ReadOnlySequence<byte> ReadToEnd()
Returns | Edit this page View Source Read<T>()

Parses the value encoded as a sequence of bytes.

Declaration
public T Read<T>() where T : IBinaryFormattable<T>
Returns Type Description T

The parsed value.

Type Parameters Name Description T

The type of the result.

| Edit this page View Source Reset()

Resets the reader so it can be used again.

Declaration | Edit this page View Source Skip(long)

Skips the specified number of bytes.

Declaration
public void Skip(long length)
Parameters Type Name Description long length

The number of bytes to skip.

Exceptions | Edit this page View Source ToString()

Returns the fully qualified type name of this instance.

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

The fully qualified type name.

Overrides | Edit this page View Source TryRead(int, out ReadOnlyMemory<byte>)

Tries to read the next chunk.

Declaration
public bool TryRead(int maxLength, out ReadOnlyMemory<byte> chunk)
Parameters Type Name Description int maxLength

The maximum length of the requested chunk.

ReadOnlyMemory<byte> chunk

The chunk of bytes. Its length is less than or equal to maxLength.

Returns Type Description bool

true if next chunk is obtained successfully; false if the end of the stream reached.

| Edit this page View Source TryRead(out ReadOnlyMemory<byte>)

Tries to read the next chunk.

Declaration
public bool TryRead(out ReadOnlyMemory<byte> chunk)
Parameters Returns Type Description bool

true if the next chunk is obtained successfully; false if the end of the stream reached.

Implements Extension Methods See Also

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