01: package org.jgroups.tests;
02:
03: import org.jgroups.Message;
04: import org.jgroups.conf.ClassConfigurator;
05:
06: import java.io.DataInputStream;
07: import java.io.FileInputStream;
08:
09: /**
10: * @author Bela Ban
11: * @version $Id$
12: */
13: public class bla {
14:
15: static final byte LIST = 1; // we have a list of messages rather than a single message when set
16: static final byte MULTICAST = 2;
17:
18: public static void main(String[] args) throws Exception {
19: DataInputStream in = new DataInputStream(new FileInputStream(
20: "c:\\data.dat"));
21: short version = in.readShort();
22:
23: byte flags = in.readByte();
24: boolean is_message_list = (flags & LIST) == LIST;
25: boolean multicast = (flags & MULTICAST) == MULTICAST;
26:
27: ClassConfigurator config = ClassConfigurator.getInstance(true);
28:
29: Message msg = new Message(false); // don't create headers, readFrom() will do this
30: msg.readFrom(in);
31: // postUnmarshalling(msg, dest, sender, multicast); // allows for optimization by subclass
32:
33: }
34: }
|