Represents a memory buffer that stores an entire message for future consumption.
public ref class MessageBuffer abstract : IDisposable
public abstract class MessageBuffer : IDisposable
type MessageBuffer = class interface IDisposable
Public MustInherit Class MessageBuffer Implements IDisposable
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 MessageBuffer class to completely store an entire Message instance into memory.
A MessageBuffer instance is constructed by calling CreateBufferedCopy of a Message instance. A new MessageBuffer is then created and returned, which assumes ownership of the Message and reads the entire content into memory.
In order to retrieve a copy of a Message from the MessageBuffer, you must call the CreateMessage method of the MessageBuffer. This returns an identical copy of the original Message instance you provided.
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.
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.
Initializes a new instance of the MessageBuffer class.
Gets the approximate number of bytes consumed by this MessageBuffer.
Gets the type of message content stored in this buffer.
Finishes working with the buffer.
Returns a copy of the original message.
Creates a new XPathNavigator object for navigating this object. This method cannot be inherited.
Creates a new XPathNavigator object for navigating this object, with the navigator positioned on the node specified.
Creates a new XPathNavigator object for navigating this object, with the navigator positioned on the specified node and
Creates a new XPathNavigator object for navigating this object, with the specified
Determines whether the specified object is equal to the current object.(Inherited from Object)
Serves as the default hash function.(Inherited from Object)
Gets the Type of the current instance.(Inherited from Object)
Creates a shallow copy of the current Object.(Inherited from Object)
Returns a string that represents the current object.(Inherited from Object)
Writes the entire content of this buffer to the specified IO stream.
Explicit Interface Implementations
Releases the unmanaged resources used by the MessageBuffer and optionally releases the managed resources. This method cannot be inherited.