Message.Expand
Method
Visual Basic
Public SubExpand
(
ByVal additionalStorage As UInt32)
C#
public voidExpand
(
uint additionalStorage);
Purpose
Enlarge a message by allocating additional storage.
Remarks
.NET programs store messages in unmanaged objects. When adding data to a message would overflow the allocated space, the message automatically expands by allocating additional storage. However, reallocation (whether explicit or automatic) is a slow operation; to optimize program performance, we recommend allocating sufficient storage initially, so that reallocation is not required.
If no space is available, this method throws an exception with the error code NoMemory.
Parameter |
Description |
|
Enlarge the message by this amount (in bytes) to allocate for the message. If the message was |