Export (0) Print
Expand All

BufferManager Class

Many Windows Communication Foundation (WCF) features require the use of buffers, which are expensive to create and destroy. You can use the BufferManager class to manage a buffer pool. The pool and its buffers are created when you instantiate this class and destroyed when the buffer pool is reclaimed by garbage collection. Every time you need to use a buffer, you take one from the pool, use it, and return it to the pool when done. This process is much faster than creating and destroying a buffer every time you need to use one.

System.Object
  System.ServiceModel.Channels.BufferManager

Namespace:  System.ServiceModel.Channels
Assemblies:   System.ServiceModel.Primitives (in System.ServiceModel.Primitives.dll)
  System.ServiceModel (in System.ServiceModel.dll)

public abstract class BufferManager

The BufferManager type exposes the following members.

  NameDescription
Protected methodSupported by Portable Class LibraryBufferManagerInitializes a new instance of the BufferManager class.
Top

  NameDescription
Public methodSupported by Portable Class LibraryClearReleases the buffers currently cached in the manager.
Public methodStatic memberSupported by Portable Class LibraryCreateBufferManagerCreates a new BufferManager with a specified maximum buffer pool size and a maximum size for each individual buffer in the pool.
Public methodSupported by Portable Class LibraryEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodSupported by Portable Class LibraryFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Portable Class LibraryMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Portable Class LibraryReturnBufferReturns a buffer to the pool.
Public methodSupported by Portable Class LibraryTakeBufferGets a buffer of at least the specified size from the pool.
Public methodSupported by Portable Class LibraryToStringReturns a string that represents the current object. (Inherited from Object.)
Top

This class is commonly used while implementing custom encoders or custom transport channels.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft