AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="1.1.0-alpha-376" />

 IReadOnlyTextSource

public interface IReadOnlyTextSource : IDisposable
Represents a text source that can be read from.
Encoding CurrentEncoding { get; set; }

Gets or sets the encoding to use.

int Index { get; set; }

Gets or sets the current index of the insertation and read point.

char this[int index] { get; }

Gets the character at the given position in the text buffer.

int Length { get; }

Gets the length of the text buffer.

string Text { get; }

Gets the full text buffer.

Prefetches the whole stream by expanding the internal buffer.

Task PrefetchAsync(int length, CancellationToken cancellationToken)

Prefetches the number of bytes by expanding the internal buffer.

Reads the next character from the buffer or underlying stream, if any.

string ReadCharacters(int characters)

Reads the upcoming numbers of characters from the buffer or underlying stream, if any.

StringOrMemory ReadMemory(int characters)

Reads the upcoming numbers of characters from the buffer or underlying stream, if any.

bool TryGetContentLength(out int length)

Gets the content length, if known.