Message.CreateBufferedCopy(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Stores an entire Message into a memory buffer for future access.
public:
System::ServiceModel::Channels::MessageBuffer ^ CreateBufferedCopy(int maxBufferSize);
public System.ServiceModel.Channels.MessageBuffer CreateBufferedCopy (int maxBufferSize);
member this.CreateBufferedCopy : int -> System.ServiceModel.Channels.MessageBuffer
Public Function CreateBufferedCopy (maxBufferSize As Integer) As MessageBuffer
Parameters
- maxBufferSize
- Int32
The maximum size of the buffer to be created.
Returns
A newly created MessageBuffer object.
Exceptions
maxBufferSize
is smaller than zero.
The message is closed.
The message has been copied, read or written.
Remarks
The body of a Message instance can only be accessed or written once. If you want to access 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.
Note
If Version is equal to None, this method only stores the body of the message, not the entire message into the memory buffer.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈