Package javax.jms

Examples of javax.jms.BytesMessage.reset()


         foreignBytesMessage.writeByte((byte)i);
      }

      HornetQBytesMessage copy = new HornetQBytesMessage(foreignBytesMessage, session);

      foreignBytesMessage.reset();
      copy.reset();

      MessageHeaderTestBase.ensureEquivalent(foreignBytesMessage, copy);
   }
View Full Code Here


                            ((TextMessage) message).getText());
                        wrapper.addChild(textData);
                    } else if (message instanceof BytesMessage) {
                        BytesMessage bm = (BytesMessage) message;
                        byte[] msgBytes = new byte[(int) bm.getBodyLength()];
                        bm.reset();
                        bm.readBytes(msgBytes);
                        DataHandler dataHandler = new DataHandler(
                            new ByteArrayDataSource(msgBytes));
                        OMText textData = soapFactory.createOMText(dataHandler, true);
                        wrapper.addChild(textData);
View Full Code Here

        catch (MessageNotReadableException e)
        {
          // Ignore
        }
       
        msg.reset();
       
        // Make sure message is read-only
        try
        {
          msg.writeByte((byte)12);
View Full Code Here

        Object result2 = trans.transform(compressedBytes);
        assertTrue("Transformed object should be a Bytes message", result2 instanceof BytesMessage);

        // check whether the BytesMessage contains the compressed bytes
        BytesMessage intermediate = (BytesMessage)result2;
        intermediate.reset();
        byte[] intermediateBytes = new byte[(int)(intermediate.getBodyLength())];
        int intermediateSize = intermediate.readBytes(intermediateBytes);
        assertTrue("Intermediate bytes must be compressed", compressor.isCompressed(intermediateBytes));
        assertTrue("Intermediate bytes must be equal to compressed source", Arrays.equals(compressedBytes,
            intermediateBytes));
View Full Code Here

                            ((TextMessage) message).getText());
                        wrapper.addChild(textData);
                    } else if (message instanceof BytesMessage) {
                        BytesMessage bm = (BytesMessage) message;
                        byte[] msgBytes = new byte[(int) bm.getBodyLength()];
                        bm.reset();
                        bm.readBytes(msgBytes);
                        DataHandler dataHandler = new DataHandler(
                            new ByteArrayDataSource(msgBytes));
                        OMText textData = soapFactory.createOMText(dataHandler, true);
                        wrapper.addChild(textData);
View Full Code Here

        } else {
            ActiveMQMessage activeMessage = null;

            if (message instanceof BytesMessage) {
                BytesMessage bytesMsg = (BytesMessage)message;
                bytesMsg.reset();
                ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
                msg.setConnection(connection);
                try {
                    for (;;) {
                        // Reads a byte from the message stream until the stream
View Full Code Here

         foreignBytesMessage.writeByte((byte)i);
      }

      HornetQBytesMessage copy = new HornetQBytesMessage(foreignBytesMessage, session);

      foreignBytesMessage.reset();
      copy.reset();

      MessageHeaderTestBase.ensureEquivalent(foreignBytesMessage, copy);
   }
View Full Code Here

      long bodyLength = m2.getBodyLength();

      ProxyAssertSupport.assertEquals(161, bodyLength);

      m2.reset();

      // test the unsigned reads

      m2.readBoolean();
      int unsignedByte = m2.readUnsignedByte();
View Full Code Here

      catch (MessageNotReadableException e)
      {
         // OK
      }

      m2.reset();

      ProxyAssertSupport.assertEquals(0, m2.getBodyLength());

      // Test that changing the received message doesn't affect the sent message
      m.reset();
View Full Code Here

         foreignBytesMessage.writeByte((byte)i);
      }

      HornetQBytesMessage copy = new HornetQBytesMessage(foreignBytesMessage, session);

      foreignBytesMessage.reset();
      copy.reset();

      MessageHeaderTestBase.ensureEquivalent(foreignBytesMessage, copy);
   }
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.