StringBuilderPool Class

Namespace
Kampute.DocToolkit.Support
Assembly
  • Kampute.DocToolkit.dll

Definition

Provides a pool of StringBuilder instances to minimize memory allocations.
public class StringBuilderPool
Inheritance

Constructors

StringBuilderPool()Initializes a new instance of the StringBuilderPool class with a default capacity.
StringBuilderPool(int)Initializes a new instance of the StringBuilderPool class with a specified capacity.

Fields

SharedThe shared instance of the StringBuilderPool for global use.

Properties

CapacityGets the maximum number of StringBuilder instances in the pool.
CountGets the current number of StringBuilder instances in the pool.

Methods

Clear()Clears all StringBuilder instances from the pool.
GetBuilder()Acquires a StringBuilderPool.ReusableStringBuilder from the pool.
GetWriter()Acquires a StringWriter that uses a pooled StringBuilder.
GetWriter(IFormatProvider)Acquires a StringWriter that uses a pooled StringBuilder with a specified format provider.
Recycle(StringBuilder)Returns a StringBuilder to the pool.