<PackageReference Include="System.Text.Json" Version="7.0.3" />

ReadBufferState

public ReadOnlySpan<byte> Bytes { get; }

public bool IsFinalBlock { get; }

public ReadBufferState(int initialBufferSize)

public void AdvanceBuffer(int bytesConsumed)

Advances the buffer in anticipation of a subsequent read operation.

public void Dispose()

public void ReadFromStream(Stream utf8Json)

Read from the stream until either our buffer is filled or we hit EOF. Calling ReadCore is relatively expensive, so we minimize the number of times we need to call it.

public ValueTask<ReadBufferState> ReadFromStreamAsync(Stream utf8Json, CancellationToken cancellationToken, bool fillBuffer = true)

Read from the stream until either our buffer is filled or we hit EOF. Calling ReadCore is relatively expensive, so we minimize the number of times we need to call it.