Skip to content

MemoryStreamBufferWriter.GetMemory(int)

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.