Name

BytesMessage

Synopsis

A BytesMessage is a Message that contains an uninterpreted stream of bytes as its body. This would typically be used to wrap an existing (non-JMS) message format so that it could be delivered over JMS. Data is written to the message’s binary body using its write methods, and read using its read methods. Once a BytesMessage has been created (using a series of write calls), the reset() method can be used to put the message into read-only mode. Until this is done, the message is in write-only mode, and the contents cannot be read back.

                  Exceptions
public interface BytesMessage extends javax.jms.Message {
// Public Instance Methods
   public abstract boolean readBoolean() throws JMSException;  
   public abstract byte readByte() throws JMSException;  
   public abstract int readBytes(
        byte[] value) throws JMSException;  
   public abstract int readBytes(byte[] value, 
        int length) throws JMSException;  
   public abstract char readChar() throws JMSException;  
   public abstract double readDouble() throws JMSException;  
   public abstract float readFloat() throws JMSException;  
   public abstract int readInt() throws JMSException;  
   public abstract long readLong() throws JMSException;  
   public abstract short readShort() throws JMSException;  
   public abstract int readUnsignedByte(
        ) throws JMSException;  
   public abstract int readUnsignedShort(
        ) throws JMSException;  
   public abstract String readUTF() throws JMSException; ...

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.