BodyWriter.OnCreateBufferedCopy Method

Provides an extensibility point when the body contents are written.

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

protected virtual BodyWriter OnCreateBufferedCopy(
	int 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.

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.


Supported in: 5, 4

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

Community Additions