Message.CreateBufferedCopy(Int32) Message.CreateBufferedCopy(Int32) Message.CreateBufferedCopy(Int32) Message.CreateBufferedCopy(Int32) Method

定义

将整个 Message 存储到内存缓冲区,以供日后访问。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

参数

maxBufferSize
Int32 Int32 Int32 Int32

要创建的缓冲区的最大大小。The maximum size of the buffer to be created.

返回

新创建的 MessageBuffer 对象。A newly created MessageBuffer object.

异常

已复制、读取或写入消息。The message has been copied, read or written.

注解

Message 实例的正文只可访问或写入一次。The body of a Message instance can only be accessed or written once. 如果希望不止一次访问 Message 实例,则应该使用 MessageBuffer 类将整个 Message 实例全部存储到内存。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. MessageBuffer 实例是通过调用 CreateBufferedCopy 实例的 Message 构造的。A MessageBuffer instance is constructed by calling CreateBufferedCopy of a Message instance.

备注

如果 Version 等于 None,使用这个方法只会将消息的正文,而不是整个消息存储到内存缓冲区。If Version is equal to None, this method only stores the body of the message, not the entire message into the memory buffer.

适用于