Example #1
0
 @Override
 public String readUTF() throws JMSException {
   if (!readMode) throw new MessageNotReadableException("Message not readable");
   try {
     return readOnlyMessage.readUTF();
   } catch (IOException eof) {
     MessageEOFException eofEx = new MessageEOFException("eof ?");
     eofEx.setLinkedException(eof);
     throw eofEx;
   }
 }
Example #2
0
 @Override
 public int readBytes(byte[] data, int length) throws JMSException {
   if (!readMode) throw new MessageNotReadableException("Message not readable");
   try {
     return readOnlyMessage.readBytes(data, length);
   } catch (IOException eof) {
     MessageEOFException eofEx = new MessageEOFException("eof ?");
     eofEx.setLinkedException(eof);
     throw eofEx;
   }
 }
Example #3
0
 private byte[] getPayloadData() throws IOException {
   if (readMode) return readOnlyMessage.getDataCopy();
   return writeOnlyMessage.getPayloadAsBytes();
 }
Example #4
0
 @Override
 public long getBodyLength() throws JMSException {
   if (!readMode) throw new MessageNotReadableException("Message not readable");
   return readOnlyMessage.getBodyLength();
 }