Package javax.jms

Examples of javax.jms.StreamMessage.readBytes()


      ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0);
      ProxyAssertSupport.assertEquals(myDouble, m2.readDouble(), 0);
      ProxyAssertSupport.assertEquals(myString, m2.readString());

      bytes = new byte[6];
      ret = m2.readBytes(bytes);
      ProxyAssertSupport.assertEquals(6, ret);
      assertByteArraysEqual(myBytes, bytes);

      ret = m2.readBytes(bytes);
      ProxyAssertSupport.assertEquals(-1, ret);
View Full Code Here


      bytes = new byte[6];
      ret = m2.readBytes(bytes);
      ProxyAssertSupport.assertEquals(6, ret);
      assertByteArraysEqual(myBytes, bytes);

      ret = m2.readBytes(bytes);
      ProxyAssertSupport.assertEquals(-1, ret);

      // Try and read past the end of the stream
      try
      {
View Full Code Here

      StreamMessage sm = (StreamMessage)m;

      ProxyAssertSupport.assertTrue(sm.readBoolean());

      byte bytes[] = new byte[5];
      sm.readBytes(bytes);
      String s = new String(bytes);
      ProxyAssertSupport.assertEquals("jboss", s);
      ProxyAssertSupport.assertEquals(-1, sm.readBytes(bytes));

      ProxyAssertSupport.assertEquals(sm.readChar(), 'c');
View Full Code Here

      byte bytes[] = new byte[5];
      sm.readBytes(bytes);
      String s = new String(bytes);
      ProxyAssertSupport.assertEquals("jboss", s);
      ProxyAssertSupport.assertEquals(-1, sm.readBytes(bytes));

      ProxyAssertSupport.assertEquals(sm.readChar(), 'c');
      ProxyAssertSupport.assertEquals(sm.readDouble(), 1.0D, 0.0D);
      ProxyAssertSupport.assertEquals(sm.readFloat(), 2.0F, 0.0F);
      ProxyAssertSupport.assertEquals(sm.readInt(), 3);
View Full Code Here

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

      log.debug("recv: "+recv);
      assertTrue("Boolean == true", recv.readBoolean() == true);
      assertTrue("Byte == 1", recv.readByte() == 1);
      // Quirky spec behavior requires a read past the end of the byte[] field
      byte[] bytes = new byte[testBytes.length];
      recv.readBytes(bytes);
      assertTrue(recv.readBytes(bytes) < 0);
      assertTrue("Bytes == Bytes[]",
         Arrays.equals(bytes, testBytes));
      char c = recv.readChar();
      assertTrue("Char == c", c == 'c');
View Full Code Here

      ret = m2.readBytes(bytes);
      assertEquals(-1, ret);

      byte[] bytes2 = new byte[3];
      ret = m2.readBytes(bytes2);

      assertEquals(3, ret);

      assertEquals(myBytes[2], bytes2[0]);
      assertEquals(myBytes[3], bytes2[1]);
View Full Code Here

      assertEquals(myBytes[2], bytes2[0]);
      assertEquals(myBytes[3], bytes2[1]);
      assertEquals(myBytes[4], bytes2[2]);

      ret = m2.readBytes(bytes2);
      assertEquals(-1, ret);

      assertEquals(myBool, m2.readBoolean());
      assertEquals(myByte, m2.readByte());
      assertEquals(myShort, m2.readShort());
View Full Code Here

      assertEquals(myFloat, m2.readFloat(), 0);
      assertEquals(myDouble, m2.readDouble(), 0);
      assertEquals(myString, m2.readString());

      bytes = new byte[6];
      ret = m2.readBytes(bytes);
      assertEquals(6, ret);
      assertByteArraysEqual(myBytes, bytes);

      ret = m2.readBytes(bytes);
      assertEquals(-1, ret);
View Full Code Here

      bytes = new byte[6];
      ret = m2.readBytes(bytes);
      assertEquals(6, ret);
      assertByteArraysEqual(myBytes, bytes);

      ret = m2.readBytes(bytes);
      assertEquals(-1, ret);

      //Try and read past the end of the stream
      try
      {
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.