Share via


BodyWriter.OnCreateBufferedCopy Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Provides an extensibility point when the body contents are written.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

Syntax

'Declaration
Protected Overridable Function OnCreateBufferedCopy ( _
    maxBufferSize As Integer _
) As BodyWriter
protected virtual BodyWriter OnCreateBufferedCopy(
    int maxBufferSize
)

Parameters

  • maxBufferSize
    Type: System.Int32
    The maximum size of the buffer for the body.

Return Value

Type: System.ServiceModel.Channels.BodyWriter
A BodyWriter with the specified maximum buffer size.

Remarks

A class derived from BodyWriter can override this method to create a buffered copy of the BodyWriter. But the default implementation of WriteBodyContents(XmlDictionaryWriter) calls OnWriteBodyContents(XmlDictionaryWriter), so overriding just OnWriteBodyContents(XmlDictionaryWriter) should be easier and work for most scenarios.

Note that the BodyWriter returned must be buffered, that is IsBuffered must be true.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.