Package javax.jms

Examples of javax.jms.BytesMessage.reset()


            chunk.writeBytes(buf, 0, length);
            if (length < bufSize)
               chunk.setBooleanProperty(XBConnectionMetaData.JMSX_GROUP_EOF, true);
            chunk.setLongProperty(XBConnectionMetaData.JMSX_GROUP_SEQ, count);
            chunk.reset();
            producer.send(dest, chunk);
            count++;
            if (length < bufSize)
               return;
         }           
View Full Code Here


      bm.writeFloat(9.0f);
      bm.writeInt(10);
      bm.writeLong(11l);
      bm.writeShort((short)12);
      bm.writeUTF("this is an UTF String");
      bm.reset();
   }

   @Override
   protected void assertEquivalent(final Message m, final int mode, final boolean redelivered) throws JMSException
   {
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

        } 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

        } 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

        int n = 0;

        if (message instanceof BytesMessage) {
            try {
                BytesMessage bs = (BytesMessage) message;
                bs.reset();
                n = bs.readBytes(body);
            } catch (JMSException ex) {
                return ex.toString();
            }
        } else if (message instanceof StreamMessage) {
View Full Code Here

        return XmlUtils.isXML(text);
      }

      if (message instanceof BytesMessage) {
        BytesMessage bytesMsg = (BytesMessage) message;
        bytesMsg.reset();

        final byte[] decl = new byte["<?xml".length()];
        bytesMsg.readBytes(decl);

        return XmlUtils.isXML(new String(decl));
View Full Code Here

        XMLBytesMessage bytesRval = (XMLBytesMessage) rval;
        BytesMessage bytesMessage = (BytesMessage) message;
        ByteArrayOutputStream bosream = new ByteArrayOutputStream();

        bytesMessage.reset();

        try {
          for (;;) {
            bosream.write(bytesMessage.readByte());
          }
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.