Package javax.jms

Examples of javax.jms.BytesMessage.writeByte()


   public void testBytesMessage() throws Exception
   {
      log.info("+++ testBytesMessage");
      BytesMessage sent = session.createBytesMessage();
      sent.writeBoolean(true);
      sent.writeByte((byte) 1);
      byte[] testBytes = "Bytes".getBytes();
      sent.writeBytes(testBytes);
      sent.writeChar('c');
      sent.writeShort((short) 31415);
      sent.writeInt(314159);
View Full Code Here


      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);
View Full Code Here

      ClientSession session = new FakeSession(clientMessage);

      BytesMessage foreignBytesMessage = new SimpleJMSBytesMessage();
      for (int i = 0; i < 20; i++)
      {
         foreignBytesMessage.writeByte((byte)i);
      }

      HornetQBytesMessage copy = new HornetQBytesMessage(foreignBytesMessage, session);

      foreignBytesMessage.reset();
View Full Code Here

      log.trace("String is length:" + myString.length());
      char myChar = 'q';
      byte[] myBytes = new byte[] { -23, 114, -126, -12, 74, 87 };

      m.writeBoolean(myBool);
      m.writeByte(myByte);
      m.writeShort(myShort);
      m.writeChar(myChar);
      m.writeInt(myInt);
      m.writeLong(myLong);
      m.writeFloat(myFloat);
View Full Code Here

      {
         // OK
      }
      try
      {
         m2.writeByte(myByte);
         ProxyAssertSupport.fail();
      }
      catch (javax.jms.MessageNotWriteableException e)
      {
         // OK
View Full Code Here

        jmsTemplate.setPubSubDomain(false);
        jmsTemplate.send("test.bytes", new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                BytesMessage bytesMessage = session.createBytesMessage();
                bytesMessage.writeByte((byte) 1);
                bytesMessage.writeByte((byte) 2);
                bytesMessage.writeByte((byte) 3);
                return bytesMessage;
            }
        });
View Full Code Here

        jmsTemplate.setPubSubDomain(false);
        jmsTemplate.send("test.bytes", new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                BytesMessage bytesMessage = session.createBytesMessage();
                bytesMessage.writeByte((byte) 1);
                bytesMessage.writeByte((byte) 2);
                bytesMessage.writeByte((byte) 3);
                return bytesMessage;
            }
        });
View Full Code Here

        jmsTemplate.send("test.bytes", new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                BytesMessage bytesMessage = session.createBytesMessage();
                bytesMessage.writeByte((byte) 1);
                bytesMessage.writeByte((byte) 2);
                bytesMessage.writeByte((byte) 3);
                return bytesMessage;
            }
        });

        endpoint.assertIsSatisfied();
View Full Code Here

   public void testCopyOnForeignBytesMessage() throws JMSException
   {
      BytesMessage foreignBytesMessage = new SimpleJMSBytesMessage();
      for(int i = 0; i < 20; i++)
      {
         foreignBytesMessage.writeByte((byte)i);
      }

      JBossBytesMessage copy = new JBossBytesMessage(foreignBytesMessage, 0);

      foreignBytesMessage.reset();
View Full Code Here

   public void testBytesMessage() throws Exception
   {
      log.info("+++ testBytesMessage");
      BytesMessage sent = session.createBytesMessage();
      sent.writeBoolean(true);
      sent.writeByte((byte) 1);
      byte[] testBytes = "Bytes".getBytes();
      sent.writeBytes(testBytes);
      sent.writeChar('c');
      sent.writeShort((short) 31415);
      sent.writeInt(314159);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.