@Override public void writeDouble(final double value) throws JMSException { message.writeDouble(value); }
public void writeDouble(double value) throws JMSException { ((BytesMessage) message).writeDouble(value); }
public void writeDouble(double value) throws JMSException { ((BytesMessage) message).writeDouble(value); }
/** * Write * @param value The value * @exception JMSException Thrown if an error occurs */ public void writeDouble(final double value) throws JMSException { if (_log.isTraceEnabled()) { _log.trace("writeDouble(" + value + ")"); } ((BytesMessage)_message).writeDouble(value); }
/** * Write * * @param value The value * @throws JMSException Thrown if an error occurs */ @Override public void writeDouble(final double value) throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("writeDouble(" + value + ")"); } ((BytesMessage) message).writeDouble(value); }
/** * Write * * @param value The value * @throws JMSException Thrown if an error occurs */ @Override public void writeDouble(final double value) throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("writeDouble(" + value + ")"); } ((BytesMessage) message).writeDouble(value); }
/** * Send a <code>BytesMessage</code> with 2 Java primitives in its body (a <code> * String</code> and a <code>double</code>). * <br /> * Receive it and test that the values of the primitives of the body are correct */ public void testBytesMessage_2() { try { byte[] bytes = new String("pi").getBytes(); BytesMessage message = senderSession.createBytesMessage(); message.writeBytes(bytes); message.writeDouble(3.14159); sender.send(message); Message m = receiver.receive(TestConfig.TIMEOUT); assertTrue("The message should be an instance of BytesMessage.\n", m instanceof BytesMessage); BytesMessage msg = (BytesMessage) m; byte[] receivedBytes = new byte[bytes.length]; msg.readBytes(receivedBytes); assertEquals(new String(bytes), new String(receivedBytes)); assertEquals(3.14159, msg.readDouble(), 0); } catch (JMSException e) { fail(e); } }
public static Message createBytesMessage(Session session, Object payload, PayloadType payloadType) throws JMSException { BytesMessage message = session.createBytesMessage(); switch (payloadType) { case BOOLEAN: message.writeBoolean((Boolean) payload); break; case BYTE: message.writeByte((Byte) payload); break; case CHARACTER: message.writeChar((Character) payload); break; case DOUBLE: message.writeDouble((Double) payload); break; case FLOAT: message.writeFloat((Float) payload); break; case INTEGER: message.writeInt((Integer) payload); break; case LONG: message.writeLong((Long) payload); break; case SHORT: message.writeShort((Short) payload); break; } return message; }
/** * Send a <code>BytesMessage</code> with 2 Java primitives in its body (a <code> * String</code> and a <code>double</code>). * <br /> * Receive it and test that the values of the primitives of the body are correct */ @Test public void testBytesMessage_2() { try { byte[] bytes = new String("pi").getBytes(); BytesMessage message = senderSession.createBytesMessage(); message.writeBytes(bytes); message.writeDouble(3.14159); sender.send(message); Message m = receiver.receive(TestConfig.TIMEOUT); Assert.assertTrue("The message should be an instance of BytesMessage.\n", m instanceof BytesMessage); BytesMessage msg = (BytesMessage) m; byte[] receivedBytes = new byte[bytes.length]; msg.readBytes(receivedBytes); Assert.assertEquals(new String(bytes), new String(receivedBytes)); Assert.assertEquals(3.14159, msg.readDouble(), 0); } catch (JMSException e) { fail(e); } }
@Override protected void prepareMessage(final Message m) throws JMSException { super.prepareMessage(m); BytesMessage bm = (BytesMessage) m; bm.writeBoolean(true); bm.writeByte((byte) 3); bm.writeBytes(new byte[]{(byte) 4, (byte) 5, (byte) 6}); bm.writeChar((char) 7); bm.writeDouble(8.0); bm.writeFloat(9.0f); bm.writeInt(10); bm.writeLong(11L); bm.writeShort((short) 12); bm.writeUTF("this is an UTF String"); bm.reset(); }
m.writeLong(myLong); m.writeFloat(myFloat); m.writeDouble(myDouble); m.writeUTF(myString); m.writeBytes(myBytes); m2.writeDouble(myDouble); ProxyAssertSupport.fail(); } catch (javax.jms.MessageNotWriteableException e) {