KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > tests > EncryptOrderTestHeader


1 // $Id: EncryptOrderTestHeader.java,v 1.1 2005/04/08 08:11:51 steview Exp $
2

3 package org.jgroups.tests;
4
5
6 import org.jgroups.Address;
7 import org.jgroups.Header;
8 import org.jgroups.ViewId;
9
10 import java.io.IOException JavaDoc;
11 import java.io.ObjectInput JavaDoc;
12 import java.io.ObjectOutput JavaDoc;
13 import java.util.Vector JavaDoc;
14
15
16
17 public class EncryptOrderTestHeader extends Header {
18    
19
20     long seqno=-1; // either reg. NAK_ACK_MSG or first_seqno in retransmissions
21

22   
23
24     public EncryptOrderTestHeader() {}
25     
26
27
28     public EncryptOrderTestHeader(long seqno) {
29
30     this.seqno=seqno;
31     }
32
33
34     public long size() {
35     return 512;
36     }
37
38
39     public void writeExternal(ObjectOutput JavaDoc out) throws IOException JavaDoc {
40     
41     out.writeLong(seqno);
42     }
43
44
45
46     public void readExternal(ObjectInput JavaDoc in) throws IOException JavaDoc, ClassNotFoundException JavaDoc {
47
48     seqno=in.readLong();
49
50     }
51
52
53     public EncryptOrderTestHeader copy() {
54     EncryptOrderTestHeader ret=new EncryptOrderTestHeader(seqno);
55     return ret;
56     }
57
58
59    
60
61     public String JavaDoc toString() {
62     StringBuffer JavaDoc ret=new StringBuffer JavaDoc();
63     ret.append("[ENCRYPT_ORDER_TEST: seqno=" + seqno);
64     ret.append(']');
65
66     return ret.toString();
67     }
68
69 }
70
Popular Tags