<PackageReference Include="Microsoft.Data.SqlClient" Version="7.1.0-preview2.26190.5" />

System.Buffers.ArrayBufferWriter<T>

sealed class ArrayBufferWriter<T> : IBufferWriter<T>
Internal implementation of IBufferWriter<T> for platforms that don't have it available. NOTE: This file should not be edited as it is copied from dotnet/runtime and has no tests in this repo. It is only included for netfx version of the driver because this class was not introduced until netstandard 2.1.
public int Capacity { get; }

Returns the total amount of space within the underlying buffer.

public int FreeCapacity { get; }

Returns the amount of space available that can still be written into without forcing the underlying buffer to grow.

public int WrittenCount { get; }

Returns the amount of data written to the underlying buffer so far.

public ReadOnlyMemory<T> WrittenMemory { get; }

Returns the data written to the underlying buffer so far, as a ReadOnlyMemory<T>.

public ReadOnlySpan<T> WrittenSpan { get; }

Returns the data written to the underlying buffer so far, as a ReadOnlySpan<T>.

Creates an instance of an ArrayBufferWriter<T>, in which data can be written to, with the default initial capacity.

public ArrayBufferWriter(int initialCapacity)

Creates an instance of an ArrayBufferWriter<T>, in which data can be written to, with an initial capacity specified.

public void Advance(int count)

Notifies IBufferWriter<T> that count amount of data was written to the output Span<T>/ Memory<T>

public void Clear()

Clears the data written to the underlying buffer.

public Memory<T> GetMemory(int sizeHint = 0)

Returns a Memory<T> to write to that is at least the requested length (specified by sizeHint). If no sizeHint is provided (or it's equal to 0), some non-empty buffer is returned.

public Span<T> GetSpan(int sizeHint = 0)

Returns a Span<T> to write to that is at least the requested length (specified by sizeHint). If no sizeHint is provided (or it's equal to 0), some non-empty buffer is returned.

public void ResetWrittenCount()

Resets the data written to the underlying buffer without zeroing its content.