Package net.timewalker.ffmq3.common.message

Examples of net.timewalker.ffmq3.common.message.StreamMessageImpl.writeByte()


    try { msg.readDouble(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    assertEquals(123,msg.readByte());
   
    // String
    msg = new StreamMessageImpl();
    msg.writeByte((byte)123);
    msg.markAsReadOnly();
    assertEquals("123",msg.readString());
   
    // Bytes
    msg = new StreamMessageImpl();
View Full Code Here


    msg.markAsReadOnly();
    assertEquals("123",msg.readString());
   
    // Bytes
    msg = new StreamMessageImpl();
    msg.writeByte((byte)123);
    msg.markAsReadOnly();
    try { msg.readBytes(new byte[1]); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertEquals(123,msg.readByte());
  }
 
 
View Full Code Here

        RawDataBuffer rawMsg = message.getRawMessage();
        if (rawMsg != null)
            return rawMsg.toByteArray();

        RawDataBuffer buffer = new RawDataBuffer(typicalSize);
        buffer.writeByte(message.getType());
        message.serializeTo(buffer);
       
        return buffer.toByteArray();
    }
   
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.