Package com.sun.ts.tests.jms.common
Class StreamMessageTestImpl
java.lang.Object
com.sun.ts.tests.jms.common.MessageTestImpl
com.sun.ts.tests.jms.common.StreamMessageTestImpl
- All Implemented Interfaces:
- jakarta.jms.Message,- jakarta.jms.StreamMessage
Class Declaration.
- Version:
- 1.2, 09/26/00
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byteFields inherited from class com.sun.ts.tests.jms.common.MessageTestImplbufferIsDirty, dummy, readModeFields inherited from interface jakarta.jms.MessageDEFAULT_DELIVERY_DELAY, DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidMethod Declaration.booleanRead abooleanfrom the stream message.bytereadByte()Read a byte value from the stream message.intreadBytes(byte[] value) Read a byte array from the stream message.charreadChar()Read a Unicode character value from the stream message.doubleRead adoublefrom the stream message.floatRead afloatfrom the stream message.intreadInt()Read a 32-bit integer from the stream message.longreadLong()Read a 64-bit integer from the stream message.Read a Java object from the stream message.shortRead a 16-bit number from the stream message.Read in a string from the stream message.voidreset()Put the message in read-only mode, and reposition the stream to the beginning.voidwriteBoolean(boolean value) Write abooleanto the stream message.voidwriteByte(byte value) Write out abyteto the stream message.voidwriteBytes(byte[] value) Write a byte array to the stream message.voidwriteBytes(byte[] value, int offset, int length) Write a portion of a byte array to the stream message.voidwriteChar(char value) Write acharto the stream message.voidwriteDouble(double value) Write adoubleto the stream message.voidwriteFloat(float value) Write afloatto the stream message.voidwriteInt(int value) Write anintto the stream message.voidwriteLong(long value) Write alongto the stream message.voidwriteObject(Object value) Write a Java object to the stream message.voidwriteShort(short value) Write ashortto the stream message.voidwriteString(String value) Write a string to the stream message.Methods inherited from class com.sun.ts.tests.jms.common.MessageTestImplacknowledge, checkReadAccess, clearProperties, getBody, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDeliveryTime, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, isBodyAssignableTo, propertyExists, setBooleanProperty, setBufferIsDirty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDeliveryTime, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringPropertyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.jms.Messageacknowledge, clearProperties, getBody, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDeliveryTime, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, isBodyAssignableTo, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDeliveryTime, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty
- 
Field Details- 
BOOLEAN_TYPEpublic static final byte BOOLEAN_TYPE- See Also:
 
- 
BYTE_TYPEpublic static final byte BYTE_TYPE- See Also:
 
- 
CHAR_TYPEpublic static final byte CHAR_TYPE- See Also:
 
- 
DOUBLE_TYPEpublic static final byte DOUBLE_TYPE- See Also:
 
- 
FLOAT_TYPEpublic static final byte FLOAT_TYPE- See Also:
 
- 
INT_TYPEpublic static final byte INT_TYPE- See Also:
 
- 
LONG_TYPEpublic static final byte LONG_TYPE- See Also:
 
- 
SHORT_TYPEpublic static final byte SHORT_TYPE- See Also:
 
- 
STRING_TYPEpublic static final byte STRING_TYPE- See Also:
 
- 
BYTES_TYPEpublic static final byte BYTES_TYPE- See Also:
 
 
- 
- 
Constructor Details- 
StreamMessageTestImplpublic StreamMessageTestImpl()Class Constructor.
 
- 
- 
Method Details- 
readBooleanpublic boolean readBoolean() throws jakarta.jms.JMSExceptionRead abooleanfrom the stream message.- Specified by:
- readBooleanin interface- jakarta.jms.StreamMessage
- Returns:
- the booleanvalue read.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readBytepublic byte readByte() throws jakarta.jms.JMSExceptionRead a byte value from the stream message.- Specified by:
- readBytein interface- jakarta.jms.StreamMessage
- Returns:
- the next byte from the stream message as a 8-bit byte.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readShortpublic short readShort() throws jakarta.jms.JMSExceptionRead a 16-bit number from the stream message.- Specified by:
- readShortin interface- jakarta.jms.StreamMessage
- Returns:
- a 16-bit number from the stream message.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readCharpublic char readChar() throws jakarta.jms.JMSExceptionRead a Unicode character value from the stream message.- Specified by:
- readCharin interface- jakarta.jms.StreamMessage
- Returns:
- a Unicode character from the stream message.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readIntpublic int readInt() throws jakarta.jms.JMSExceptionRead a 32-bit integer from the stream message.- Specified by:
- readIntin interface- jakarta.jms.StreamMessage
- Returns:
- a 32-bit integer value from the stream message, interpreted as a int.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readLongpublic long readLong() throws jakarta.jms.JMSExceptionRead a 64-bit integer from the stream message.- Specified by:
- readLongin interface- jakarta.jms.StreamMessage
- Returns:
- a 64-bit integer value from the stream message, interpreted as a long.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readFloatpublic float readFloat() throws jakarta.jms.JMSExceptionRead afloatfrom the stream message.- Specified by:
- readFloatin interface- jakarta.jms.StreamMessage
- Returns:
- a floatvalue from the stream message.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readDoublepublic double readDouble() throws jakarta.jms.JMSExceptionRead adoublefrom the stream message.- Specified by:
- readDoublein interface- jakarta.jms.StreamMessage
- Returns:
- a doublevalue from the stream message.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readStringRead in a string from the stream message.- Specified by:
- readStringin interface- jakarta.jms.StreamMessage
- Returns:
- a Unicode string from the stream message.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readBytespublic int readBytes(byte[] value) throws jakarta.jms.JMSException Read a byte array from the stream message.- Specified by:
- readBytesin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the buffer into which the data is read.
- Returns:
- the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageFormatException- if this type conversion is invalid
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
readObjectRead a Java object from the stream message. Note that this method can be used to return in objectified format, an object that had been written to the Stream with the equivalentwriteObjectmethod call, or it's equivalent primitive writemethod. - Specified by:
- readObjectin interface- jakarta.jms.StreamMessage
- Returns:
- a Java object from the stream message, in objectified format (ie. if it set as an int, then a Integer is returned).
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageEOFException- if an end of message stream
- jakarta.jms.MessageNotReadableException- if message in write-only mode.
 
- 
writeBooleanpublic void writeBoolean(boolean value) throws jakarta.jms.JMSException Write abooleanto the stream message. The valuetrueis written out as the value(byte)1; the valuefalseis written out as the value(byte)0.- Specified by:
- writeBooleanin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the- booleanvalue to be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to read message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeBytepublic void writeByte(byte value) throws jakarta.jms.JMSException Write out abyteto the stream message.- Specified by:
- writeBytein interface- jakarta.jms.StreamMessage
- Parameters:
- value- the- bytevalue to be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeShortpublic void writeShort(short value) throws jakarta.jms.JMSException Write ashortto the stream message.- Specified by:
- writeShortin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the- shortto be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeCharpublic void writeChar(char value) throws jakarta.jms.JMSException Write acharto the stream message.- Specified by:
- writeCharin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the- charvalue to be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeIntpublic void writeInt(int value) throws jakarta.jms.JMSException Write anintto the stream message.- Specified by:
- writeIntin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the- intto be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeLongpublic void writeLong(long value) throws jakarta.jms.JMSException Write alongto the stream message.- Specified by:
- writeLongin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the- longto be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeFloatpublic void writeFloat(float value) throws jakarta.jms.JMSException Write afloatto the stream message.- Specified by:
- writeFloatin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the- floatvalue to be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeDoublepublic void writeDouble(double value) throws jakarta.jms.JMSException Write adoubleto the stream message.- Specified by:
- writeDoublein interface- jakarta.jms.StreamMessage
- Parameters:
- value- the- doublevalue to be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeStringWrite a string to the stream message.- Specified by:
- writeStringin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the- Stringvalue to be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeBytespublic void writeBytes(byte[] value) throws jakarta.jms.JMSException Write a byte array to the stream message.- Specified by:
- writeBytesin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the byte array to be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeBytespublic void writeBytes(byte[] value, int offset, int length) throws jakarta.jms.JMSException Write a portion of a byte array to the stream message.- Specified by:
- writeBytesin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the byte array value to be written.
- offset- the initial offset within the byte array.
- length- the number of bytes to use.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
 
- 
writeObjectWrite a Java object to the stream message. Note that this method only works for the objectified primitive object types (Integer, Double, Long ...), String's and byte arrays.- Specified by:
- writeObjectin interface- jakarta.jms.StreamMessage
- Parameters:
- value- the Java object to be written.
- Throws:
- jakarta.jms.JMSException- if JMS fails to write message due to some internal JMS error.
- jakarta.jms.MessageNotWriteableException- if message in read-only mode.
- jakarta.jms.MessageFormatException- if the object is invalid
 
- 
resetpublic void reset() throws jakarta.jms.JMSExceptionPut the message in read-only mode, and reposition the stream to the beginning.- Specified by:
- resetin interface- jakarta.jms.StreamMessage
- Throws:
- jakarta.jms.JMSException- if JMS fails to reset the message due to some internal JMS error.
- jakarta.jms.MessageFormatException- if message has an invalid format
 
- 
clearBodypublic void clearBody() throws jakarta.jms.JMSExceptionMethod Declaration.- Specified by:
- clearBodyin interface- jakarta.jms.Message
- Overrides:
- clearBodyin class- MessageTestImpl
- Throws:
- jakarta.jms.JMSException
 
 
-