bla.java :  » Net » JGroups-2.4.1-sp3 » org » jgroups » tests » Java Open Source

Java Open Source » Net » JGroups 2.4.1 sp3 
JGroups 2.4.1 sp3 » org » jgroups » tests » bla.java
package org.jgroups.tests;

import org.jgroups.Message;
import org.jgroups.conf.ClassConfigurator;

import java.io.DataInputStream;
import java.io.FileInputStream;

/**
 * @author Bela Ban
 * @version $Id$
 */
public class bla {

    static final byte LIST      = 1;  // we have a list of messages rather than a single message when set
    static final byte MULTICAST = 2;

    public static void main(String[] args) throws Exception {
        DataInputStream in=new DataInputStream(new FileInputStream("c:\\data.dat"));
        short version=in.readShort();

        byte flags=in.readByte();
        boolean is_message_list=(flags & LIST) == LIST;
        boolean multicast=(flags & MULTICAST) == MULTICAST;

        ClassConfigurator config=ClassConfigurator.getInstance(true);


        Message msg=new Message(false); // don't create headers, readFrom() will do this
        msg.readFrom(in);
        // postUnmarshalling(msg, dest, sender, multicast); // allows for optimization by subclass
        
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.