Package javax.jms

Examples of javax.jms.BytesMessage.reset()


                }
                pw.println();
                pw.flush();
                if (message instanceof BytesMessage) {
                    BytesMessage bytesMessage = (BytesMessage)message;
                    bytesMessage.reset();
                    IOUtils.copy(new BytesMessageInputStream(bytesMessage), out);
                } else if (message instanceof TextMessage) {
                    pw.print(((TextMessage)message).getText());
                    pw.flush();
                }
View Full Code Here


    long bodyLength = m2.getBodyLength();

    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();

    assertEquals(0, m2.getBodyLength());

    // Test that changing the received message doesn't affect the sent message
    m.reset();
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();
   }

   protected void assertEquivalent(Message m, int mode, boolean redelivered) throws JMSException
   {
      super.assertEquivalent(m, mode, redelivered);
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

                            ((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

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.