Share via


BodyWriter.CreateBufferedCopy Method

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

Creates a buffered copy of the body.

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

Syntax

'Declaration
Public Function CreateBufferedCopy ( _
    maxBufferSize As Integer _
) As BodyWriter
public BodyWriter CreateBufferedCopy(
    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 that contains a copy of this object.

Exceptions

Exception Condition
ArgumentOutOfRangeException

maxBufferSize is less than zero.

InvalidOperationException

The body has already been written and cannot be written again, or the body writer is not buffered.

Remarks

If IsBuffered is true then the BodyWriter object is returned. If IsBuffered is false then the contents of the BodyWriter up to maxBufferSize is returned. This also calls OnCreateBufferedCopy(Int32) as an extensibility point.

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.