Example usage for javax.jms MessageEOFException MessageEOFException

List of usage examples for javax.jms MessageEOFException MessageEOFException

Introduction

In this page you can find the example usage for javax.jms MessageEOFException MessageEOFException.

Prototype

public MessageEOFException(String reason) 

Source Link

Document

Constructs a MessageEOFException with the specified reason.

Usage

From source file:com.amazon.sqs.javamessaging.message.SQSBytesMessage.java

/**
 * Reads a string that has been encoded using a UTF-8 format from
 * the bytes message stream//from ww  w  .  j  a  v a 2s.  c  o  m
 * 
 * @return a Unicode string from the bytes message stream
 * @throws JMSException
 *             If the JMS provider fails to read the message due to some
 *             internal error.
 * @throws MessageEOFException
 *             If unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException
 *             If the message is in write-only mode.
 */
@Override
public String readUTF() throws JMSException {
    checkCanRead();
    try {
        return dataIn.readUTF();
    } catch (EOFException e) {
        throw new MessageEOFException(e.getMessage());
    } catch (IOException e) {
        throw convertExceptionToJMSException(e);
    }
}

From source file:org.skyscreamer.nevado.jms.message.NevadoBytesMessage.java

/**
 * Reads a <code>boolean</code> from the bytes message stream.
 *
 * @return the <code>boolean</code> value read
 * @throws JMSException                if the JMS provider fails to read the message due to some internal error.
 * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 *///from   w ww.j  av a2  s . c  o m
public boolean readBoolean() throws JMSException {
    initializeReading();
    try {
        return this.dataIn.readBoolean();
    } catch (EOFException eof) {
        JMSException jmsEx = new MessageEOFException(eof.getMessage());
        jmsEx.setLinkedException(eof);
        throw jmsEx;
    } catch (IOException ioe) {
        JMSException jmsEx = new JMSException("Format error occured" + ioe.getMessage());
        jmsEx.setLinkedException(ioe);
        throw jmsEx;
    }
}

From source file:org.skyscreamer.nevado.jms.message.NevadoBytesMessage.java

/**
 * Reads a signed 8-bit value from the bytes message stream.
 *
 * @return the next byte from the bytes message stream as a signed 8-bit <code>byte</code>
 * @throws JMSException                if the JMS provider fails to read the message due to some internal error.
 * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 *//*from w w w.ja v a 2s . com*/
public byte readByte() throws JMSException {
    initializeReading();
    try {
        return this.dataIn.readByte();
    } catch (EOFException eof) {
        JMSException jmsEx = new MessageEOFException(eof.getMessage());
        jmsEx.setLinkedException(eof);
        throw jmsEx;
    } catch (IOException ioe) {
        JMSException jmsEx = new JMSException("Format error occured" + ioe.getMessage());
        jmsEx.setLinkedException(ioe);
        throw jmsEx;
    }
}

From source file:org.skyscreamer.nevado.jms.message.NevadoBytesMessage.java

/**
 * Reads an unsigned 8-bit number from the bytes message stream.
 *
 * @return the next byte from the bytes message stream, interpreted as an unsigned 8-bit number
 * @throws JMSException                if the JMS provider fails to read the message due to some internal error.
 * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 *//*from w  w  w  .j  a v a 2  s. c o m*/
public int readUnsignedByte() throws JMSException {
    initializeReading();
    try {
        return this.dataIn.readUnsignedByte();
    } catch (EOFException eof) {
        JMSException jmsEx = new MessageEOFException(eof.getMessage());
        jmsEx.setLinkedException(eof);
        throw jmsEx;
    } catch (IOException ioe) {
        JMSException jmsEx = new JMSException("Format error occured" + ioe.getMessage());
        jmsEx.setLinkedException(ioe);
        throw jmsEx;
    }
}

From source file:org.skyscreamer.nevado.jms.message.NevadoBytesMessage.java

/**
 * Reads a signed 16-bit number from the bytes message stream.
 *
 * @return the next two bytes from the bytes message stream, interpreted as a signed 16-bit number
 * @throws JMSException                if the JMS provider fails to read the message due to some internal error.
 * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 *//*from   w  ww.jav  a 2  s . c o m*/
public short readShort() throws JMSException {
    initializeReading();
    try {
        return this.dataIn.readShort();
    } catch (EOFException eof) {
        JMSException jmsEx = new MessageEOFException(eof.getMessage());
        jmsEx.setLinkedException(eof);
        throw jmsEx;
    } catch (IOException ioe) {
        JMSException jmsEx = new JMSException("Format error occured" + ioe.getMessage());
        jmsEx.setLinkedException(ioe);
        throw jmsEx;
    }
}

From source file:org.skyscreamer.nevado.jms.message.NevadoBytesMessage.java

/**
 * Reads an unsigned 16-bit number from the bytes message stream.
 *
 * @return the next two bytes from the bytes message stream, interpreted as an unsigned 16-bit integer
 * @throws JMSException                if the JMS provider fails to read the message due to some internal error.
 * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 *///ww w .j  ava2  s  . com
public int readUnsignedShort() throws JMSException {
    initializeReading();
    try {
        return this.dataIn.readUnsignedShort();
    } catch (EOFException eof) {
        JMSException jmsEx = new MessageEOFException(eof.getMessage());
        jmsEx.setLinkedException(eof);
        throw jmsEx;
    } catch (IOException ioe) {
        JMSException jmsEx = new JMSException("Format error occured" + ioe.getMessage());
        jmsEx.setLinkedException(ioe);
        throw jmsEx;
    }
}

From source file:org.skyscreamer.nevado.jms.message.NevadoBytesMessage.java

/**
 * Reads a Unicode character value from the bytes message stream.
 *
 * @return the next two bytes from the bytes message stream as a Unicode character
 * @throws JMSException                if the JMS provider fails to read the message due to some internal error.
 * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 *//*from w  ww. j  a  va2s .  c o  m*/
public char readChar() throws JMSException {
    initializeReading();
    try {
        return this.dataIn.readChar();
    } catch (EOFException eof) {
        JMSException jmsEx = new MessageEOFException(eof.getMessage());
        jmsEx.setLinkedException(eof);
        throw jmsEx;
    } catch (IOException ioe) {
        JMSException jmsEx = new JMSException("Format error occured" + ioe.getMessage());
        jmsEx.setLinkedException(ioe);
        throw jmsEx;
    }
}

From source file:org.skyscreamer.nevado.jms.message.NevadoBytesMessage.java

/**
 * Reads a signed 32-bit integer from the bytes message stream.
 *
 * @return the next four bytes from the bytes message stream, interpreted as an <code>int</code>
 * @throws JMSException                if the JMS provider fails to read the message due to some internal error.
 * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 *///from ww w  .  j  a v a 2s .  c o m
public int readInt() throws JMSException {
    initializeReading();
    try {
        return this.dataIn.readInt();
    } catch (EOFException eof) {
        JMSException jmsEx = new MessageEOFException(eof.getMessage());
        jmsEx.setLinkedException(eof);
        throw jmsEx;
    } catch (IOException ioe) {
        JMSException jmsEx = new JMSException("Format error occured" + ioe.getMessage());
        jmsEx.setLinkedException(ioe);
        throw jmsEx;
    }
}

From source file:org.skyscreamer.nevado.jms.message.NevadoBytesMessage.java

/**
 * Reads a signed 64-bit integer from the bytes message stream.
 *
 * @return the next eight bytes from the bytes message stream, interpreted as a <code>long</code>
 * @throws JMSException                if the JMS provider fails to read the message due to some internal error.
 * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 *//*from  ww w  .  java  2s .  c  om*/
public long readLong() throws JMSException {
    initializeReading();
    try {
        return this.dataIn.readLong();
    } catch (EOFException eof) {
        JMSException jmsEx = new MessageEOFException(eof.getMessage());
        jmsEx.setLinkedException(eof);
        throw jmsEx;
    } catch (IOException ioe) {
        JMSException jmsEx = new JMSException("Format error occured" + ioe.getMessage());
        jmsEx.setLinkedException(ioe);
        throw jmsEx;
    }
}

From source file:org.skyscreamer.nevado.jms.message.NevadoBytesMessage.java

/**
 * Reads a <code>float</code> from the bytes message stream.
 *
 * @return the next four bytes from the bytes message stream, interpreted as a <code>float</code>
 * @throws JMSException                if the JMS provider fails to read the message due to some internal error.
 * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
 * @throws MessageNotReadableException if the message is in write-only mode.
 *///  w  w w.  ja  v a  2  s .c om
public float readFloat() throws JMSException {
    initializeReading();
    try {
        return this.dataIn.readFloat();
    } catch (EOFException eof) {
        JMSException jmsEx = new MessageEOFException(eof.getMessage());
        jmsEx.setLinkedException(eof);
        throw jmsEx;
    } catch (IOException ioe) {
        JMSException jmsEx = new JMSException("Format error occured" + ioe.getMessage());
        jmsEx.setLinkedException(ioe);
        throw jmsEx;
    }
}