Collapse All Expand All

.NET Framework Class Library
Tibems Class See Also

[TIBCO.EMS .NET client library 5.1 documentation]

Returns the total wire size of the message body for a message which was received or sent.

Namespace: TIBCO.EMS
Assembly: TIBCO.EMS (in TIBCO.EMS.dll)

# Syntax

    public static int GetMessageBodySize(
    	Message msg
    )

    Public Shared Function GetMessageBodySize ( _
    	msg As Message _
    ) As Integer

    public:
    static int GetMessageBodySize(
    	Message^ msg
    )

#### Parameters

msg
  Type: TIBCO.EMS..::.Message
  The message for which to return the size of the message body.

#### Return Value

The total size of the message body.

# Remarks

The size is implicitly measured and cached when an inbound message arrives at the client, and when the client sends an outbound message. If the client modifies a message, or creates a message but never sends it, then this method could yield an incorrect cached value. To explicitly force a new measurement and cache its results, call Tibems.CalculateMessageSize; then the method yields the correct value.

If the body of the message is compressed, this method returns the size of the compressed wire representation.

# Exceptions

Exception | Condition
--- | ---
System..::.ArgumentException | if parameter is null or is a foreign message implementation.

# See Also

Tibems Class
TIBCO.EMS Namespace