Skip to content

TestMultiSegmentBufferWriter Methods

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

Advance(int)

View source
public void Advance(int bytes)
Notifies the System.Buffers.IBufferWriter that count data items were written to the output System.Span or System.Memory.

Parameters

bytesint
The number of data items written to the System.Span or System.Memory.

GetMemory(int)

View source
public Memory<byte> GetMemory(int sizeHint = 0)
Returns a System.Memory to write to that is at least the requested size (specified by sizeHint).

Parameters

sizeHintint
The minimum length of the returned System.Memory. If 0, a non-empty buffer is returned.

Returns

A System.Memory of at least the size sizeHint. If sizeHint is 0, returns a non-empty buffer.

Exceptions

System.OutOfMemoryException
The requested buffer size is not available.

GetSpan(int)

View source
public Span<byte> GetSpan(int sizeHint)
Returns a System.Span to write to that is at least the requested size (specified by sizeHint).

Parameters

sizeHintint
The minimum length of the returned System.Span. If 0, a non-empty buffer is returned.

Returns

A System.Span of at least the size sizeHint. If sizeHint is 0, returns a non-empty buffer.