[TIBCO.EMS.UFOCLIENT .NET client library 5.1 documentation]

A BytesMessage object is used to send a message containing a stream of uninterpreted bytes. It inherits from the Message interface and adds a bytes message body. The receiver of the message supplies the interpretation of the bytes.

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

Syntax

[SerializableAttribute]
public class BytesMessage : Message
<SerializableAttribute> _
Public Class BytesMessage _
	Inherits Message
[SerializableAttribute]
public ref class BytesMessage : public Message

Remarks

This message type is for client encoding of existing message formats. If possible, one of the other self-defining message types should be used instead.

The primitive types can be written explicitly using methods for each type. They may also be written generically as objects. For instance, a call to BytesMessage.writeInt(6) is equivalent to BytesMessage.writeObject((object)6). Both forms are provided, because the explicit form is convenient for static programming, and the object form is needed when types are not known at compile time.

When the message is first created, and when clearBody is called, the body of the message is in write-only mode. After the first call to reset has been made, the message body is in read-only mode. After a message has been sent, the client that sent it can retain and modify it without affecting the message that has been sent. The same message object can be sent multiple times. When a message has been received, the provider has called reset so that the message body is in read-only mode for the client.

If clearBody is called on a message in read-only mode, the message body is cleared and the message is in write-only mode.

If a client attempts to read a message in write-only mode, a MessageNotReadableException is thrown.

If a client attempts to write a message in read-only mode, a MessageNotWriteableException is thrown.

Inheritance Hierarchy

System..::.Object
  TIBCO.EMS.UFO..::.Message
    TIBCO.EMS.UFO..::.BytesMessage

See Also