RecyclableMemoryStreamManager.Options.ThrowExceptionOnToArray property

December 6, 2023 · View on GitHub

Causes an exception to be thrown if ToArray is ever called.

public bool ThrowExceptionOnToArray { get; set; }

Remarks

Calling ToArray defeats the purpose of a pooled buffer. Use this property to discover code that is calling ToArray. If this is set and ToArray is called, a NotSupportedException will be thrown.

See Also