Package net.timewalker.ffmq3.utils

Examples of net.timewalker.ffmq3.utils.RawDataBuffer.toByteArray()


   
    private byte[] serialize( AbstractMessage message ) throws Exception
    {
        RawDataBuffer buffer = new RawDataBuffer(1024);
        MessageSerializer.serializeTo(message, buffer);
        return buffer.toByteArray();
    }
   
    private AbstractMessage unserialize( byte[] data ) throws Exception
    {
        RawDataBuffer buffer = new RawDataBuffer(data);
View Full Code Here


     */
    public static byte[] serialize( AbstractMessage message , int typicalSize )
    {
        RawDataBuffer rawMsg = message.getRawMessage();
        if (rawMsg != null)
            return rawMsg.toByteArray();

        RawDataBuffer buffer = new RawDataBuffer(typicalSize);
        buffer.writeByte(message.getType());
        message.serializeTo(buffer);
       
View Full Code Here

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