BodyWriter.OnCreateBufferedCopy(Int32) 方法

定义

在写入正文内容时提供可扩展点。

protected:
 virtual System::ServiceModel::Channels::BodyWriter ^ OnCreateBufferedCopy(int maxBufferSize);
protected virtual System.ServiceModel.Channels.BodyWriter OnCreateBufferedCopy (int maxBufferSize);
abstract member OnCreateBufferedCopy : int -> System.ServiceModel.Channels.BodyWriter
override this.OnCreateBufferedCopy : int -> System.ServiceModel.Channels.BodyWriter
Protected Overridable Function OnCreateBufferedCopy (maxBufferSize As Integer) As BodyWriter

参数

maxBufferSize
Int32

正文缓冲区的最大大小。

返回

具有指定最大缓冲区大小的 BodyWriter

注解

派生自 BodyWriter 的类可以重写此方法以创建 BodyWriter 的缓冲副本。 但 WriteBodyContents(XmlDictionaryWriter) 的默认实现调用 OnWriteBodyContents(XmlDictionaryWriter),因此仅重写 OnWriteBodyContents(XmlDictionaryWriter) 应更容易,且适合大多数情况。

请注意,必须缓冲返回的 BodyWriter,即 IsBuffered 必须为 true

适用于