TIBCO EMS .NET API 8.5 TIBCO EMS .NET API 8.5

- Main Page
- Related Pages
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Properties | List of all members
TIBCO.EMS.UFO.StreamMessage Class Reference

A StreamMessage object is used to send a stream of primitive types in the .NET programming language. It is filled and read sequentially. It inherits from the Message interface and adds a stream message body. More...

Inheritance diagram for TIBCO.EMS.UFO.StreamMessage:

## Public Member Functions
override Object | Clone ()
| Create a copy of the StreamMessage object. More...
override void | ClearBody ()
| Clears a message body in preparation for writing More...
bool | ReadBoolean ()
| Reads a boolean from the stream message. More...
byte | ReadByte ()
| Reads a byte from the stream message. More...
short | ReadShort ()
| Reads a short from the stream message. More...
char | ReadChar ()
| Reads a char from the stream message. More...
int | ReadInt ()
| Reads an int from the stream message. More...
long | ReadLong ()
| Reads a long from the stream message. More...
float | ReadFloat ()
| Reads a float from the stream message. More...
double | ReadDouble ()
| Reads a double from the stream message. More...
string | ReadString ()
| Reads a string from the stream message. More...
int | ReadBytes (byte[] value)
| Reads a byte array from the stream message. More...
object | ReadObject ()
| Reads an object from the stream message. More...
void | WriteBoolean (bool value)
| Writes a boolean to the stream message. More...
void | WriteByte (byte value)
| Writes a byte to the stream message. More...
void | WriteShort (short value)
| Writes a short to the stream message. More...
void | WriteChar (char value)
| Writes a char to the stream message. More...
void | WriteInt (int value)
| Writes an int to the stream message. More...
void | WriteLong (long value)
| Writes a long to the stream message. More...
void | WriteFloat (float value)
| Writes a float to the stream message. More...
void | WriteDouble (double value)
| Writes a double to the stream message. More...
void | WriteString (string value)
| Writes a string to the stream message. More...
void | WriteBytes (byte[] value)
| Writes a byte array to the stream message. More...
void | WriteBytes (byte[] value, int offset, int length)
| Writes a portion of a byte array as a byte array field to the stream message. More...
void | WriteObject (object value)
| Writes an object to the stream message. More...
void | Reset ()
| Puts the message body in read-only mode and repositions the stream to the beginning More...
override string | ToString ()
| Return a string representation of the message More...
Public Member Functions inherited from TIBCO.EMS.UFO.Message
virtual void | ClearProperties ()
| Clears a message's properties. More...
virtual bool | PropertyExists (string name)
| Test whether a named property has been set on a message. More...
bool | GetBooleanProperty (string name)
| Returns the value of the boolean property with the specified name. More...
byte | GetByteProperty (string name)
| Returns the value of the byte property with the specified name. More...
short | GetShortProperty (string name)
| Returns the value of the short property with the specified name. More...
int | GetIntProperty (string name)
| Returns the value of the int property with the specified name. More...
long | GetLongProperty (string name)
| Returns the value of the long property with the specified name. More...
float | GetFloatProperty (string name)
| Returns the value of the float property with the specified name. More...
double | GetDoubleProperty (string name)
| Returns the value of the double property with the specified name. More...
string | GetStringProperty (string name)
| Returns the value of the string property with the specified name. More...
object | GetObjectProperty (string name)
| Returns the value of the object property with the specified name. More...
void | SetBooleanProperty (string name, bool value)
| Sets a boolean property value with the specified name into the message More...
void | SetByteProperty (string name, byte value)
| Sets a byte property value with the specified name into the message More...
void | SetShortProperty (string name, short value)
| Sets a short property value with the specified name into the message More...
void | SetIntProperty (string name, int value)
| Sets a int property value with the specified name into the message More...
void | SetLongProperty (string name, long value)
| Sets a long property value with the specified name into the message More...
void | SetFloatProperty (string name, float value)
| Sets a float property value with the specified name into the message More...
void | SetDoubleProperty (string name, double value)
| Sets a double property value with the specified name into the message More...
void | SetStringProperty (string name, string value)
| Sets a string property value with the specified name into the message More...
void | SetObjectProperty (string name, object value)
| Sets an object property value with the specified name into the message More...
virtual void | Acknowledge ()
| Acknowledges all consumed messages of the session of this consumed message. More...
override string | ToString ()
| returns a string representation of the message More...

## Properties
int | FieldCount`[get]`
| Returns number of fields that this message holds. More...
Properties inherited from TIBCO.EMS.UFO.Message
string | CorrelationID`[get, set]`
| Gets and Sets the correlation ID for the message. More...
byte[] | CorrelationIDAsBytes`[get, set]`
| Gets and Sets the correlation ID as an array of bytes for the message. More...
int | DeliveryMode`[get, set]`
| Get and set the message's delivery mode as an integer constant as defined in the DeliveryMode class. Users are recommended to use the MessageDeliveryMode enum instead. More...
TIBCO.EMS.MessageDeliveryMode | MsgDeliveryMode`[get, set]`
| Get and set the message's delivery mode as enum value of type MessageDeliveryMode More...
Destination | Destination`[get, set]`
| Gets and Sets the Destination object for this message. More...
long | Expiration`[get, set]`
| Gets and Sets the message's expiration value. More...
string | MessageID`[get, set]`
| Gets and Sets the message ID for the message. More...
string | MsgType`[get, set]`
| Gets and Sets the message's type value. More...
int | Priority`[get, set]`
| Gets and Sets the message's priority value. More...
bool | Redelivered`[get, set]`
| Gets and Sets the message's redelivered value. More...
Destination | ReplyTo`[get, set]`
| Gets and Sets the message's replyto value. More...
long | Timestamp`[get, set]`
| Gets and Sets the timestamp for the message. More...
long | DeliveryTime`[get]`
| Gets the message's delivery time value. More...
System.Collections.IEnumerator | PropertyNames`[get]`
| Returns an Enumeration of all the property names. More...

## Additional Inherited Members
Static Public Member Functions inherited from TIBCO.EMS.UFO.Message
static string | GetDeliveryModeName (TIBCO.EMS.MessageDeliveryMode deliveryMode)
static string | GetDeliveryModeName (int deliveryMode)
Public Attributes inherited from TIBCO.EMS.UFO.Message
const int | DEFAULT_DELIVERY_MODE
| The message producer's default delivery mode is PERSISTENT. More...
const MessageDeliveryMode | DEFAULT_MSG_DELIVERY_MODE
| The message producer's default delivery mode is PERSISTENT. More...
const int | DEFAULT_PRIORITY = 4
| The message producer's default priority is 4. More...
const long | DEFAULT_TIME_TO_LIVE = 0
| The message producer's default time to live is unlimited; the message never expires. More...

## Detailed Description

A StreamMessage object is used to send a stream of primitive types in the .NET programming language. It is filled and read sequentially. It inherits from the Message interface and adds a stream message body.

Each datum in the stream must be a primitive type, or an object representation of a primitive type.

The primitive types can be read or written explicitly using methods for each type. They may also be read or written generically as objects. For instance, a call to StreamMessage.writeInt(6) is equivalent to StreamMessage.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 body 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.

Extensions

TIBCO Enterprise Message Service extends the MapMessage and StreamMessage body types in two ways. These extensions allow TIBCO Enterprise Message Service to exchange messages with TIBCO Rendezvous and ActiveEnterprise formats that have certain features not available within the JMS specification.

- You can insert another MapMessage or StreamMessage instance as a submessage into a MapMessage or StreamMessage, generating a series of nested messages, instead of a flat message.
- You can use arrays as well as primitive types for the values.

These extensions add considerable flexibility to the two body types. However, they are extensions and therefore not compliant with JMS specifications. Extended messages are tagged as extensions with the vendor property tag JMS_TIBCO_MSG_EXT.

## Member Function Documentation

override void TIBCO.EMS.UFO.StreamMessage.ClearBody | ( |  | ) |
| inline virtual

Clears a message body in preparation for writing

When clearBody is called, the message body is cleared and the message body is set to write-only mode. After the first call to reset has been made, the message body is in read-only mode.

Reimplemented from TIBCO.EMS.UFO.Message.

override Object TIBCO.EMS.UFO.StreamMessage.Clone | ( |  | ) |
| inline virtual

Create a copy of the StreamMessage object.

Reimplemented from TIBCO.EMS.UFO.Message.

bool TIBCO.EMS.UFO.StreamMessage.ReadBoolean | ( |  | ) |
| inline

Reads a boolean from the stream message.

This method reads a byte of data from the stream and advances the read position so that the next read call gets the next datum.

Returns
  the boolean value read

byte TIBCO.EMS.UFO.StreamMessage.ReadByte | ( |  | ) |
| inline

Reads a byte from the stream message.

This method reads a byte of data from the stream and advances the read position so that the next read call gets the next datum.

Returns
  the byte value read

int TIBCO.EMS.UFO.StreamMessage.ReadBytes | ( | byte[] | value | ) |
| inline

Reads a byte array from the stream message.

Each call reads bytes from the stream into the byte array, and advances the read position.

This call returns the actual number of bytes read. When the call cannot read even one byte, it returns -1.

A program that calls this method must call it repeatedly until it returns -1, indicating that the program has extracted the complete set of bytes. Only then may the program call another read method.

Returns
  The byte array value read, or -1 when there are no more bytes to read.

char TIBCO.EMS.UFO.StreamMessage.ReadChar | ( |  | ) |
| inline

Reads a char from the stream message.

This method reads two bytes of data from the stream and advances the read position so that the next read call gets the next datum.

Returns
  the char value read

double TIBCO.EMS.UFO.StreamMessage.ReadDouble | ( |  | ) |
| inline

Reads a double from the stream message.

This method reads eight bytes of data from the stream and advances the read position so that the next read call gets the next datum.

Returns
  the double value read

float TIBCO.EMS.UFO.StreamMessage.ReadFloat | ( |  | ) |
| inline

Reads a float from the stream message.

This method reads four bytes of data from the stream and advances the read position so that the next read call gets the next datum.

Returns
  the float value read

int TIBCO.EMS.UFO.StreamMessage.ReadInt | ( |  | ) |
| inline

Reads an int from the stream message.

This method reads four bytes of data from the stream and advances the read position so that the next read call gets the next datum.

Returns
  the int value read

long TIBCO.EMS.UFO.StreamMessage.ReadLong | ( |  | ) |
| inline

Reads a long from the stream message.

This method reads eight bytes of data from the stream and advances the read position so that the next read call gets the next datum.

Returns
  the long value read

object TIBCO.EMS.UFO.StreamMessage.ReadObject | ( |  | ) |
| inline

Reads an object from the stream message.

Returns
  the object value read

short TIBCO.EMS.UFO.StreamMessage.ReadShort | ( |  | ) |
| inline

Reads a short from the stream message.

This method reads two bytes of data from the stream and advances the read position so that the next read call gets the next datum.

Returns
  the short value read

string TIBCO.EMS.UFO.StreamMessage.ReadString | ( |  | ) |
| inline

Reads a string from the stream message.

Returns
  the string value read

void TIBCO.EMS.UFO.StreamMessage.Reset | ( |  | ) |
| inline

Puts the message body in read-only mode and repositions the stream to the beginning

Reset prepares a message body for reading, as if the message were newly received. This method contrasts with the ClearBody method, which clears a message body in preparation for writing, as if it were newly created.

override string TIBCO.EMS.UFO.StreamMessage.ToString | ( |  | ) |
| inline

Return a string representation of the message

Returns
  string representation of the message

void TIBCO.EMS.UFO.StreamMessage.WriteBoolean | ( | bool | value | ) |
| inline

Writes a boolean to the stream message.

Each call writes a data value to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the boolean value to be written. The value true is written as (byte)1; the value false is written as (byte)0.

void TIBCO.EMS.UFO.StreamMessage.WriteByte | ( | byte | value | ) |
| inline

Writes a byte to the stream message.

Each call writes a data value to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the byte value to be written

void TIBCO.EMS.UFO.StreamMessage.WriteBytes | ( | byte[] | value | ) |
| inline

Writes a byte array to the stream message.

Each call writes bytes from the byte array to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the byte array value to be written

void TIBCO.EMS.UFO.StreamMessage.WriteBytes | ( | byte[] | value,
|  | int | offset,
|  | int | length
| ) |  |
| inline

Writes a portion of a byte array as a byte array field to the stream message.

Each call writes bytes from the byte array to the stream and advances the write position so that the next write call appends to the new end of the stream.

The a portion of the byte array value is written to the message as a byte array field. Consecutively written byte array fields are treated as two distinct fields when the fields are read.

This method attempts to write the specified bytes to the stream; otherwise it attempts to write the entire byte array. The offset and length arguments must be between zero and value.length (inclusive) and their sum must also fall within the same range. That is, these two arguments must specify a span of bytes within the value argument. Otherwise the call throws an IndexOutOfRangeException (and does not write any bytes).

Parameters

  value | the byte value to be written
  offset | the initial offset within the byte array
  length | the number of bytes to use

void TIBCO.EMS.UFO.StreamMessage.WriteChar | ( | char | value | ) |
| inline

Writes a char to the stream message.

Each call writes a data value to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the char value to be written

void TIBCO.EMS.UFO.StreamMessage.WriteDouble | ( | double | value | ) |
| inline

Writes a double to the stream message.

Each call writes a data value to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the double value to be written

void TIBCO.EMS.UFO.StreamMessage.WriteFloat | ( | float | value | ) |
| inline

Writes a float to the stream message.

Each call writes a data value to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the float value to be written

void TIBCO.EMS.UFO.StreamMessage.WriteInt | ( | int | value | ) |
| inline

Writes an int to the stream message.

Each call writes a data value to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the int value to be written

void TIBCO.EMS.UFO.StreamMessage.WriteLong | ( | long | value | ) |
| inline

Writes a long to the stream message.

Each call writes a data value to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the long value to be written

void TIBCO.EMS.UFO.StreamMessage.WriteObject | ( | object | value | ) |
| inline

Writes an object to the stream message.

This method converts an object to a primitive value (if possible) and writes that value to the stream message.

Parameters

  value | the object to be written

void TIBCO.EMS.UFO.StreamMessage.WriteShort | ( | short | value | ) |
| inline

Writes a short to the stream message.

Each call writes a data value to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the short value to be written

void TIBCO.EMS.UFO.StreamMessage.WriteString | ( | string | value | ) |
| inline

Writes a string to the stream message.

Each call writes a data value to the stream and advances the write position so that the next write call appends to the new end of the stream.

Parameters

  value | the string value to be written

## Property Documentation

int TIBCO.EMS.UFO.StreamMessage.FieldCount
| get

Returns number of fields that this message holds.