Export (0) Print
Expand All

BinaryMessageFormatter.Write Method

Serializes an object into the body of the message.

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

public void Write(
	Message message,
	Object obj
)

Parameters

message
Type: System.Messaging.Message

The Message whose Body property will contain the serialized object.

obj
Type: System.Object

The object to be serialized into the message body.

Implements

IMessageFormatter.Write(Message, Object)

ExceptionCondition
ArgumentNullException

The message parameter is null.

The top object format and type format need not be specified to write to the queue as they must be when reading. The TopObjectFormat and TypeFormat properties are used by the formatter only when deserializing a message.

The BinaryMessageFormatter can serialize most objects, but the result is not loosely coupled. However, it is compact, so the formatter is efficient for large objects.

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft