BytesMessage—Read


Method

Declaration

bool ReadBoolean(); 
sbyte ReadByte(); 
byte ReadUnsignedByte(); 
short ReadShort(); 
ushort ReadUnsignedShort(); 
char ReadChar(); 
int ReadInt(); 
long ReadLong(); 
float ReadFloat(); 
double ReadDouble(); 
String ReadUTF(); 

Purpose

Read primitive datatypes from the byte stream in the message body.

Remarks

The JMS specification defines these eleven methods to extract data from the byte stream of a BytesMessage.

Each call reads a unit of data from the stream, and advances the read position so that the next read call gets the next datum.

Parameter
Description
value

The method reads a datum from the message, and stores it in this location.

length
ReadUTF reads a UTF-8 string. Since the length of the string cannot be determined in advance, the method stores the actual length of the string in this location.

Table 6 BytesMessage Read Methods (Sheet 1 of 2)
Method
# Bytes
Interpret As
ReadBoolean
1
bool
ReadByte
1
sbyte
ReadUnsignedByte
1
byte
ReadShort
2
short
ReadUnsignedShort
2
ushort
ReadChar
2
char
ReadInt
4
int
ReadLong
8
long
ReadFloat
4
float
ReadDouble
8
double
ReadUTF
varies
String
Encoded as UTF-8

See Also

BytesMessage.ReadBytes


TIBCO Enterprise Message Service™ .NET Reference
System Release 4.3, February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com