use of javax.jms.MessageEOFException in project rocketmq-externals by apache.
the class JmsBytesMessage method handleInputException.
private JMSException handleInputException(final IOException e) {
JMSException ex;
if (e instanceof EOFException) {
ex = new MessageEOFException(e.getMessage());
} else {
ex = new MessageFormatException(e.getMessage());
}
ex.initCause(e);
ex.setLinkedException(e);
return ex;
}
use of javax.jms.MessageEOFException in project rabbitmq-jms-client by rabbitmq.
the class RMQBytesMessage method readLong.
/**
* {@inheritDoc}
*/
@Override
public long readLong() throws JMSException {
if (!this.reading)
throw new MessageNotReadableException(NOT_READABLE);
if (this.pos + Bits.NUM_BYTES_IN_LONG > this.buf.length)
throw new MessageEOFException(MSG_EOF);
long l = Bits.getLong(this.buf, this.pos);
this.pos += Bits.NUM_BYTES_IN_LONG;
return l;
}
use of javax.jms.MessageEOFException in project rabbitmq-jms-client by rabbitmq.
the class RMQBytesMessage method readInt.
/**
* {@inheritDoc}
*/
@Override
public int readInt() throws JMSException {
if (!this.reading)
throw new MessageNotReadableException(NOT_READABLE);
if (this.pos + Bits.NUM_BYTES_IN_INT > this.buf.length)
throw new MessageEOFException(MSG_EOF);
int i = Bits.getInt(this.buf, this.pos);
this.pos += Bits.NUM_BYTES_IN_INT;
return i;
}
use of javax.jms.MessageEOFException in project rabbitmq-jms-client by rabbitmq.
the class RMQBytesMessage method readShort.
/**
* {@inheritDoc}
*/
@Override
public short readShort() throws JMSException {
if (!this.reading)
throw new MessageNotReadableException(NOT_READABLE);
if (this.pos + Bits.NUM_BYTES_IN_SHORT > this.buf.length)
throw new MessageEOFException(MSG_EOF);
short s = Bits.getShort(this.buf, this.pos);
this.pos += Bits.NUM_BYTES_IN_SHORT;
return s;
}
use of javax.jms.MessageEOFException in project rabbitmq-jms-client by rabbitmq.
the class RMQBytesMessage method readUnsignedShort.
/**
* {@inheritDoc}
*/
@Override
public int readUnsignedShort() throws JMSException {
if (!this.reading)
throw new MessageNotReadableException(NOT_READABLE);
if (this.pos + Bits.NUM_BYTES_IN_SHORT > this.buf.length)
throw new MessageEOFException(MSG_EOF);
short s = Bits.getShort(this.buf, this.pos);
this.pos += Bits.NUM_BYTES_IN_SHORT;
return ((int) s) & 0xFFFF;
}
Aggregations