Package javax.jms

Examples of javax.jms.StreamMessage.readBytes()


    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

      sm.reset();

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

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

        } else if ( message instanceof BytesMessage ) {
            BytesMessage m = createBytesMessage ();
            BytesMessage src = (BytesMessage) message;
            final int LEN = 100;
            byte[] buf = new byte[LEN];
            int bytesRead = src.readBytes ( buf );
            while ( bytesRead >= 0 ) {
                m.writeBytes ( buf, 0, bytesRead );
                bytesRead = src.readBytes ( buf );
            }
View Full Code Here

            final int LEN = 100;
            byte[] buf = new byte[LEN];
            int bytesRead = src.readBytes ( buf );
            while ( bytesRead >= 0 ) {
                m.writeBytes ( buf, 0, bytesRead );
                bytesRead = src.readBytes ( buf );
            }

            ret = m;
        } else {
            // no known subinterface of Message
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.