Export (0) Print
Expand All

MessagePropertyFilter.DefaultBodySize Property

Gets or sets the size, in bytes, of the default body buffer.

Namespace:  System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

[MessagingDescriptionAttribute("MsgDefaultBodySize")]
public int DefaultBodySize { get; set; }

Property Value

Type: System.Int32
The default body buffer size to create when the message is received. The default is 1024 bytes.

ExceptionCondition
ArgumentException

The assigned value is negative.

The default body size specifies the number of bytes to allocate for the message's body contents. The Body property of the Message class represents the serialized contents of the message. The body can contain up to 4 MB of data. Restricting the body size can improve performance.

The following code example demonstrates the use of the DefaultBodySize property.

// Set the filter's DefaultBodySize property to 2048 bytes.
queue.MessageReadPropertyFilter.DefaultBodySize = 2048;

// Display the new value of the filter's DefaultBodySize property.
Console.WriteLine("MessageReadPropertyFilter.DefaultBodySize: {0}",
    queue.MessageReadPropertyFilter.DefaultBodySize.ToString());

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft