Package javax.jms

Examples of javax.jms.StreamMessage.readBytes()


         if (streamMsg instanceof XBStreamMessage) {
            long length = ((XBStreamMessage)streamMsg).getBodyLength();
            if (length >= Integer.MAX_VALUE)
               throw new XBException("feature.missing", "Handling of big message not implemented");
            content = new byte[(int)length];
            streamMsg.readBytes(content);
         }
         else
            throw new XBException("feature.missing", "Handling of non XBStreamMessage types not implemented");
      }
      else if (msg instanceof BytesMessage) {
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

      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');
      assertTrue("Short == 314159", recv.readShort() == 31415);
View Full Code Here

      sm.reset();

      ProxyAssertSupport.assertEquals(true, sm.readBoolean());
      ProxyAssertSupport.assertEquals((byte)3, sm.readByte());
      byte[] bytes = new byte[3];
      sm.readBytes(bytes);
      ProxyAssertSupport.assertEquals((byte)4, bytes[0]);
      ProxyAssertSupport.assertEquals((byte)5, bytes[1]);
      ProxyAssertSupport.assertEquals((byte)6, bytes[2]);
      ProxyAssertSupport.assertEquals(-1, sm.readBytes(bytes));
      ProxyAssertSupport.assertEquals((char)7, sm.readChar());
View Full Code Here

      byte[] bytes = new byte[3];
      sm.readBytes(bytes);
      ProxyAssertSupport.assertEquals((byte)4, bytes[0]);
      ProxyAssertSupport.assertEquals((byte)5, bytes[1]);
      ProxyAssertSupport.assertEquals((byte)6, bytes[2]);
      ProxyAssertSupport.assertEquals(-1, sm.readBytes(bytes));
      ProxyAssertSupport.assertEquals((char)7, sm.readChar());
      ProxyAssertSupport.assertEquals(new Double(8.0), new Double(sm.readDouble()));
      ProxyAssertSupport.assertEquals(new Float(9.0), new Float(sm.readFloat()));
      ProxyAssertSupport.assertEquals(10, sm.readInt());
      ProxyAssertSupport.assertEquals(11l, sm.readLong());
View Full Code Here

      {
      }
      try
      {
         byte[] bytes = new byte[333];
         m.readBytes(bytes);
         ProxyAssertSupport.fail();
      }
      catch (javax.jms.MessageNotReadableException e)
      {
      }
View Full Code Here

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

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

      assertByteArraysEqual(myBytes, bytes);

      ret = m2.readBytes(bytes);
View Full Code Here

      int ret = m2.readBytes(bytes);
      ProxyAssertSupport.assertEquals(6, ret);

      assertByteArraysEqual(myBytes, bytes);

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

      byte[] bytes2 = new byte[3];
      ret = m2.readBytes(bytes2);
View Full Code Here

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

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

      ProxyAssertSupport.assertEquals(3, ret);

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

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

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

      ProxyAssertSupport.assertEquals(myBool, m2.readBoolean());
      ProxyAssertSupport.assertEquals(myByte, m2.readByte());
      ProxyAssertSupport.assertEquals(myShort, m2.readShort());
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.