<PackageReference Include="Azure.Core" Version="1.44.0" />

BufferedReadStream

A Stream that wraps another stream and allows reading lines. The data is buffered in memory.
public ArraySegment<byte> BufferedData { get; }

The currently buffered data.

public BufferedReadStream(Stream inner, int bufferSize)

Creates a new stream.

public BufferedReadStream(Stream inner, int bufferSize, ArrayPool<byte> bytePool)

Creates a new stream.

public bool EnsureBuffered()

Ensures that the buffer is not empty.

public bool EnsureBuffered(int minCount)

Ensures that a minimum amount of buffered data is available.

public Task<bool> EnsureBufferedAsync(CancellationToken cancellationToken)

Ensures that the buffer is not empty.

public Task<bool> EnsureBufferedAsync(int minCount, CancellationToken cancellationToken)

Ensures that a minimum amount of buffered data is available.

public string ReadLine(int lengthLimit)

Reads a line. A line is defined as a sequence of characters followed by a carriage return immediately followed by a line feed. The resulting string does not contain the terminating carriage return and line feed.

public Task<string> ReadLineAsync(int lengthLimit, CancellationToken cancellationToken)

Reads a line. A line is defined as a sequence of characters followed by a carriage return immediately followed by a line feed. The resulting string does not contain the terminating carriage return and line feed.