com.caucho.jms.message
Class BytesMessageImpl

java.lang.Object
  extended by com.caucho.jms.message.MessageImpl
      extended by com.caucho.jms.message.BytesMessageImpl
All Implemented Interfaces:
java.io.Serializable, BytesMessage, Message

public class BytesMessageImpl
extends MessageImpl
implements BytesMessage

A byte-stream message.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.jms.message.MessageImpl
L, log
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
BytesMessageImpl()
           
 
Method Summary
 java.io.InputStream bodyToInputStream()
          Serialize the body to an input stream.
 void clearBody()
          Clears the message and puts it into write mode.
 MessageImpl copy()
           
protected  void copy(BytesMessageImpl newMsg)
           
 long getBodyLength()
           
protected  ReadStream getReadStream()
           
 MessageType getType()
          Returns the type enumeration.
protected  WriteStream getWriteStream()
           
 void readBody(java.io.InputStream is)
          Read the body from an input stream.
 boolean readBoolean()
          Read a boolean from the stream.
 byte readByte()
          Read a byte from the stream.
 int readBytes(byte[] value)
          Read a byte array object from the stream.
 int readBytes(byte[] value, int length)
          Read a byte array object from the stream.
 char readChar()
          Read a character object from the stream.
 double readDouble()
          Read a double from the stream.
 float readFloat()
          Read a float from the stream.
 int readInt()
          Read an integer from the stream.
 long readLong()
          Read a long from the stream.
 short readShort()
          Read a short from the stream.
 int readUnsignedByte()
          Read an unsigned byte from the stream.
 int readUnsignedShort()
          Read an unsigned short from the stream.
 java.lang.String readUTF()
          Read a string from the stream.
 void reset()
          Set the stream for reading.
 void setReceive()
          Sets the body for reading.
 java.lang.String toString()
           
 void writeBoolean(boolean b)
          Writes a boolean to the stream.
 void writeByte(byte b)
          Writes a byte to the stream.
 void writeBytes(byte[] buf)
          Writes a byte array to the stream.
 void writeBytes(byte[] buf, int offset, int length)
          Writes a byte array to the stream.
 void writeChar(char ch)
          Writes a character to the stream.
 void writeDouble(double d)
          Writes a double to the stream.
 void writeFloat(float f)
          Writes a float to the stream.
 void writeInt(int i)
          Writes an integer to the stream.
 void writeLong(long l)
          Writes a long to the stream.
 void writeObject(java.lang.Object obj)
          Writes the next object.
 void writeShort(short s)
          Writes a short to the stream.
 void writeUTF(java.lang.String s)
          Writes a string to the stream.
 
Methods inherited from class com.caucho.jms.message.MessageImpl
acknowledge, checkBodyReadable, checkBodyWriteable, checkHeaderWriteable, checkPropertyWriteable, clearProperties, copy, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getProperties, getPropertyNames, getSequence, getShortProperty, getStringProperty, isReserved, propertiesToInputStream, propertyExists, readProperties, setBodyReadOnly, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setSequence, setSession, setShortProperty, setStringProperty, writeBody, writeProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jms.Message
acknowledge, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty
 

Constructor Detail

BytesMessageImpl

public BytesMessageImpl()
Method Detail

getType

public MessageType getType()
Returns the type enumeration.

Overrides:
getType in class MessageImpl

setReceive

public void setReceive()
                throws JMSException
Sets the body for reading.

Overrides:
setReceive in class MessageImpl
Throws:
JMSException

reset

public void reset()
           throws JMSException
Set the stream for reading.

Specified by:
reset in interface BytesMessage
Throws:
JMSException

readBoolean

public boolean readBoolean()
                    throws JMSException
Read a boolean from the stream.

Specified by:
readBoolean in interface BytesMessage
Throws:
JMSException

readByte

public byte readByte()
              throws JMSException
Read a byte from the stream.

Specified by:
readByte in interface BytesMessage
Throws:
JMSException

readUnsignedByte

public int readUnsignedByte()
                     throws JMSException
Read an unsigned byte from the stream.

Specified by:
readUnsignedByte in interface BytesMessage
Throws:
JMSException

readShort

public short readShort()
                throws JMSException
Read a short from the stream.

Specified by:
readShort in interface BytesMessage
Throws:
JMSException

readUnsignedShort

public int readUnsignedShort()
                      throws JMSException
Read an unsigned short from the stream.

Specified by:
readUnsignedShort in interface BytesMessage
Throws:
JMSException

readInt

public int readInt()
            throws JMSException
Read an integer from the stream.

Specified by:
readInt in interface BytesMessage
Throws:
JMSException

readLong

public long readLong()
              throws JMSException
Read a long from the stream.

Specified by:
readLong in interface BytesMessage
Throws:
JMSException

readFloat

public float readFloat()
                throws JMSException
Read a float from the stream.

Specified by:
readFloat in interface BytesMessage
Throws:
JMSException

readDouble

public double readDouble()
                  throws JMSException
Read a double from the stream.

Specified by:
readDouble in interface BytesMessage
Throws:
JMSException

readChar

public char readChar()
              throws JMSException
Read a character object from the stream.

Specified by:
readChar in interface BytesMessage
Throws:
JMSException

readUTF

public java.lang.String readUTF()
                         throws JMSException
Read a string from the stream.

Specified by:
readUTF in interface BytesMessage
Throws:
JMSException

readBytes

public int readBytes(byte[] value)
              throws JMSException
Read a byte array object from the stream.

Specified by:
readBytes in interface BytesMessage
Throws:
JMSException

readBytes

public int readBytes(byte[] value,
                     int length)
              throws JMSException
Read a byte array object from the stream.

Specified by:
readBytes in interface BytesMessage
Throws:
JMSException

getReadStream

protected ReadStream getReadStream()
                            throws JMSException
Throws:
JMSException

clearBody

public void clearBody()
               throws JMSException
Clears the message and puts it into write mode.

Specified by:
clearBody in interface Message
Overrides:
clearBody in class MessageImpl
Throws:
JMSException

writeBoolean

public void writeBoolean(boolean b)
                  throws JMSException
Writes a boolean to the stream.

Specified by:
writeBoolean in interface BytesMessage
Throws:
JMSException

writeByte

public void writeByte(byte b)
               throws JMSException
Writes a byte to the stream.

Specified by:
writeByte in interface BytesMessage
Throws:
JMSException

writeShort

public void writeShort(short s)
                throws JMSException
Writes a short to the stream.

Specified by:
writeShort in interface BytesMessage
Throws:
JMSException

writeInt

public void writeInt(int i)
              throws JMSException
Writes an integer to the stream.

Specified by:
writeInt in interface BytesMessage
Throws:
JMSException

writeLong

public void writeLong(long l)
               throws JMSException
Writes a long to the stream.

Specified by:
writeLong in interface BytesMessage
Throws:
JMSException

writeFloat

public void writeFloat(float f)
                throws JMSException
Writes a float to the stream.

Specified by:
writeFloat in interface BytesMessage
Throws:
JMSException

writeDouble

public void writeDouble(double d)
                 throws JMSException
Writes a double to the stream.

Specified by:
writeDouble in interface BytesMessage
Throws:
JMSException

writeUTF

public void writeUTF(java.lang.String s)
              throws JMSException
Writes a string to the stream.

Specified by:
writeUTF in interface BytesMessage
Throws:
JMSException

writeChar

public void writeChar(char ch)
               throws JMSException
Writes a character to the stream.

Specified by:
writeChar in interface BytesMessage
Throws:
JMSException

writeBytes

public void writeBytes(byte[] buf)
                throws JMSException
Writes a byte array to the stream.

Specified by:
writeBytes in interface BytesMessage
Throws:
JMSException

writeBytes

public void writeBytes(byte[] buf,
                       int offset,
                       int length)
                throws JMSException
Writes a byte array to the stream.

Specified by:
writeBytes in interface BytesMessage
Throws:
JMSException

writeObject

public void writeObject(java.lang.Object obj)
                 throws JMSException
Writes the next object.

Specified by:
writeObject in interface BytesMessage
Throws:
JMSException

getBodyLength

public long getBodyLength()
                   throws JMSException
Specified by:
getBodyLength in interface BytesMessage
Throws:
JMSException

getWriteStream

protected WriteStream getWriteStream()
                              throws JMSException
Throws:
JMSException

copy

public MessageImpl copy()
Overrides:
copy in class MessageImpl

copy

protected void copy(BytesMessageImpl newMsg)

bodyToInputStream

public java.io.InputStream bodyToInputStream()
                                      throws java.io.IOException
Serialize the body to an input stream.

Overrides:
bodyToInputStream in class MessageImpl
Throws:
java.io.IOException

readBody

public void readBody(java.io.InputStream is)
              throws java.io.IOException,
                     JMSException
Read the body from an input stream.

Overrides:
readBody in class MessageImpl
Throws:
java.io.IOException
JMSException

toString

public java.lang.String toString()
Overrides:
toString in class MessageImpl