System::Buffers::ArrayBufferWriter::GetSpan method

ArrayBufferWriter::GetSpan method

Returns a Span 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.

Span<T> System::Buffers::ArrayBufferWriter<T>::GetSpan(int32_t sizeHint=0) override
ParameterTypeDescription
sizeHintint32_tThe minimum number of elements that must be available.

ReturnValue

A Span that can be written to.

Remarks

This will never return an empty Span.

There is no guarantee that successive calls will return the same buffer or the same-sized buffer.

You must request a new buffer after calling Advance to continue writing more data and cannot write to a previously acquired buffer.

See Also