BodyWriter.OnCreateBufferedCopy Method (Int32)


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

The 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.

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Available since 4.0
Return to top