Package net.timewalker.ffmq3.common.message

Examples of net.timewalker.ffmq3.common.message.BytesMessageImpl.reset()


    byte[] dummy = { (byte)1 , (byte)2 , (byte)3 };
   
    // Boolean
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    assertEquals(true,msg.readBoolean());
   
    // Byte
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
View Full Code Here


    assertEquals(true,msg.readBoolean());
   
    // Byte
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    assertEquals(1,msg.readByte());
   
    // Short
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
View Full Code Here

    assertEquals(1,msg.readByte());
   
    // Short
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    assertEquals(2+1*256,msg.readShort());
   
    // Char
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
View Full Code Here

    assertEquals(2+1*256,msg.readShort());
   
    // Char
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Int
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
View Full Code Here

    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Int
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    try { msg.readInt(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Long
    msg = new BytesMessageImpl();
View Full Code Here

    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Long
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    try { msg.readLong(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Float
    msg = new BytesMessageImpl();
View Full Code Here

    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Float
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    try { msg.readFloat(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Double
    msg = new BytesMessageImpl();
View Full Code Here

    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Double
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    try { msg.readDouble(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // String
    msg = new BytesMessageImpl();
View Full Code Here

    assertEquals(3,msg.readBytes(new byte[3]));
   
    // String
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    try { msg.readUTF(); fail("Should have failed"); } catch (MessageEOFException e) { /* OK */ }
    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Bytes
    msg = new BytesMessageImpl();
View Full Code Here

    assertEquals(3,msg.readBytes(new byte[3]));
   
    // Bytes
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    byte[] data = new byte[3];
    assertEquals(3,msg.readBytes(data));
    System.out.println(data[0]);
    assertEquals(1, data[0]);
    assertEquals(2, data[1]);
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.