jms4spread
Class BytesMessage

java.lang.Object
  |
  +--jms4spread.Message
        |
        +--jms4spread.BytesMessage
All Implemented Interfaces:
java.io.Serializable

public class BytesMessage
extends Message
implements java.io.Serializable

A ByteMessage Object is used to send a stream of uninterpretted bytes

See Also:
Serialized Form

Fields inherited from class jms4spread.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Method Summary
 void clearBody()
          Clears the Message Body
 boolean readBoolean()
          Reads a boolean from the stream
 byte readByte()
          Reads a byte from the stream
 int readBytes(byte[] value)
          Reads a byte array from the stream
 char readChar()
          Reads a char from the stream
 double readDouble()
          Reads a double from the stream
 float readFloat()
          Reads a float from the stream
 int readInt()
          Reads an int from the stream
 long readLong()
          Reads a long from the stream
 short readShort()
          Reads a short from the stream
 int readUnsignedByte()
          Reads an unsigned Byte from the Stream
 int readUnsignedShort()
          Reads an unsigned short from the stream
 java.lang.String readUTF()
          Reads a string from the stream in UTF format
 void reset()
          Puts the message in read only mode and repositions the stream to beginging
 void writeBoolean(boolean value)
          Writes a boolean to the stream
 void writeByte(byte value)
          Writes a byte to the stream
 void writeBytes(byte[] value)
          Writes an array of bytes to the stream in UTF format
 void writeBytes(byte[] value, int offset, int length)
          Writes an array of bytes to the stream in UTF format
 void writeChar(char value)
          Writes a char to the stream
 void writeDouble(double value)
          Writes a double to the stream
 void writeFloat(float value)
          Writes a float to the stream
 void writeInt(int value)
          Writes an int to the stream
 void writeLong(long value)
          Writes a long to the stream
 void writeObject(java.lang.Object value)
          Writes an array of bytes to the stream in UTF format This method only works for primitive object types
 void writeShort(short value)
          Writes a short to the stream
 void writeUTF(java.lang.String value)
          Writes a string to the stream in UTF format
 
Methods inherited from class jms4spread.Message
clearProperties, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageType, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getMessageID, JMSTimeStamp, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageType, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimeStamp, setMessageID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clearBody

public void clearBody()
               throws JMSException
Clears the Message Body
Overrides:
clearBody in class Message
Throws:
JMSException - if it fails due to some internal error

reset

public void reset()
           throws JMSException
Puts the message in read only mode and repositions the stream to beginging
Throws:
JMSException - if there in an internal error

readUnsignedByte

public int readUnsignedByte()
                     throws JMSException
Reads an unsigned Byte from the Stream
Throws:
JMSException - if there in an internal error

readUnsignedShort

public int readUnsignedShort()
                      throws JMSException
Reads an unsigned short from the stream
Throws:
JMSException - if there in an internal error

readBoolean

public boolean readBoolean()
                    throws JMSException
Reads a boolean from the stream
Throws:
JMSException - if there in an internal error

readByte

public byte readByte()
              throws JMSException
Reads a byte from the stream
Throws:
JMSException - if there in an internal error

readShort

public short readShort()
                throws JMSException
Reads a short from the stream
Throws:
JMSException - if there in an internal error

readChar

public char readChar()
              throws JMSException
Reads a char from the stream
Throws:
JMSException - if there in an internal error

readInt

public int readInt()
            throws JMSException
Reads an int from the stream
Throws:
JMSException - if there in an internal error

readLong

public long readLong()
              throws JMSException
Reads a long from the stream
Throws:
JMSException - if there in an internal error

readFloat

public float readFloat()
                throws JMSException
Reads a float from the stream
Throws:
JMSException - if there in an internal error

readDouble

public double readDouble()
                  throws JMSException
Reads a double from the stream
Throws:
JMSException - if there in an internal error

readUTF

public java.lang.String readUTF()
                         throws JMSException
Reads a string from the stream in UTF format
Throws:
JMSException - if there in an internal error

readBytes

public int readBytes(byte[] value)
              throws JMSException
Reads a byte array from the stream
Parameters:
value - the buffer into which data is read
Returns:
number of bytes read
Throws:
JMSException - if there in an internal error

writeBoolean

public void writeBoolean(boolean value)
                  throws JMSException
Writes a boolean to the stream
Throws:
JMSException - if there in an internal error

writeByte

public void writeByte(byte value)
               throws JMSException
Writes a byte to the stream
Throws:
JMSException - if there in an internal error

writeShort

public void writeShort(short value)
                throws JMSException
Writes a short to the stream
Throws:
JMSException - if there in an internal error

writeChar

public void writeChar(char value)
               throws JMSException
Writes a char to the stream
Throws:
JMSException - if there in an internal error

writeInt

public void writeInt(int value)
              throws JMSException
Writes an int to the stream
Throws:
JMSException - if there in an internal error

writeLong

public void writeLong(long value)
               throws JMSException
Writes a long to the stream
Throws:
JMSException - if there in an internal error

writeFloat

public void writeFloat(float value)
                throws JMSException
Writes a float to the stream
Throws:
JMSException - if there in an internal error

writeDouble

public void writeDouble(double value)
                 throws JMSException
Writes a double to the stream
Throws:
JMSException - if there in an internal error

writeUTF

public void writeUTF(java.lang.String value)
              throws JMSException
Writes a string to the stream in UTF format
Throws:
JMSException - if there in an internal error

writeBytes

public void writeBytes(byte[] value)
                throws JMSException
Writes an array of bytes to the stream in UTF format
Parameters:
value - the array to be written
Throws:
JMSException - if there in an internal error

writeBytes

public void writeBytes(byte[] value,
                       int offset,
                       int length)
                throws JMSException
Writes an array of bytes to the stream in UTF format
Parameters:
value - the array to be written
offset - the initial offset in the array
length - the number of bytes to use
Throws:
JMSException - if there in an internal error

writeObject

public void writeObject(java.lang.Object value)
                 throws JMSException
Writes an array of bytes to the stream in UTF format This method only works for primitive object types
Parameters:
value - the Object to be written
Throws:
JMSException - if there in an internal error