This topic has not yet been rated - Rate this topic

BufferManager Class

Many 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
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
public abstract class BufferManager

The BufferManager type exposes the following members.

  Name Description
Protected method Supported by Portable Class Library BufferManager Initializes a new instance of the BufferManager class.
Top
  Name Description
Public method Supported by Portable Class Library Clear Releases the buffers currently cached in the manager.
Public method Static member Supported by Portable Class Library CreateBufferManager Creates a new BufferManager with a specified maximum buffer pool size and a maximum size for each individual buffer in the pool.
Public method Supported by Portable Class Library Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Supported by Portable Class Library Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Supported by Portable Class Library GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method Supported by Portable Class Library GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Supported by Portable Class Library MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Supported by Portable Class Library ReturnBuffer Returns a buffer to the pool.
Public method Supported by Portable Class Library TakeBuffer Gets a buffer of at least the specified size from the pool.
Public method Supported by Portable Class Library ToString Returns 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, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ