Represents a memory buffer that stores an entire message for future consumption.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Thetype exposes the following members.
|Close||Finishes working with the buffer.|
|CreateMessage||Returns a copy of the original message.|
|CreateNavigator()||Creates a new XPathNavigator object for navigating this object. This method cannot be inherited.|
|CreateNavigator(Int32)||Creates a new XPathNavigator object for navigating this object, with the navigator positioned on the node specified.|
|CreateNavigator(XmlSpace)||Creates a new XPathNavigator object for navigating this object, with the specified xml:space scope.|
|CreateNavigator(Int32, XmlSpace)||Creates a new XPathNavigator object for navigating this object, with the navigator positioned on the specified node and xml:space scope.|
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Serves as the default hash function. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
|WriteMessage||Writes the entire content of this buffer to the specified IO stream.|
The body of a Message instance can only be consumed or written once. If you wish to consume a Message instance more than once, you should use the class to completely store an entire Message instance into memory.
You can control the maximum size of the buffer by setting BufferSize to the maximum number of bytes desired. This number does not necessarily cover any transient allocations related to building the buffer, or properties attached to the message.
You should always close a instance by calling Close when finished working with it. This allows system resources to potentially be freed sooner.
Special note for Managed C++ users deriving from this class:
Put your cleanup code in (On)(Begin)Close (and/or OnAbort), not in a destructor.
Avoid destructors: they cause the compiler to auto-generate IDisposable
Avoid non-reference members: they can cause the compiler to auto-generate IDisposable
Avoid finalizers; but if you include one, you should suppress the build warning and call SuppressFinalize(Object) and the finalizer itself from (On)(Begin)Close (and/or OnAbort) in order to emulate what would have been the auto-generated IDisposable behavior.
.NET FrameworkSupported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
.NET for Windows Phone appsSupported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.