01: // $Id: Range.java,v 1.5 2004/10/04 20:43:35 belaban Exp $
02:
03: package org.jgroups.util;
04:
05: import java.io.*;
06:
07: public class Range implements Externalizable, Streamable {
08: public long low = -1; // first msg to be retransmitted
09: public long high = -1; // last msg to be retransmitted
10:
11: /** For externalization */
12: public Range() {
13: }
14:
15: public Range(long low, long high) {
16: this .low = low;
17: this .high = high;
18: }
19:
20: public String toString() {
21: return "[" + low + " : " + high + ']';
22: }
23:
24: public void writeExternal(ObjectOutput out) throws IOException {
25: out.writeLong(low);
26: out.writeLong(high);
27: }
28:
29: public void readExternal(ObjectInput in) throws IOException,
30: ClassNotFoundException {
31: low = in.readLong();
32: high = in.readLong();
33: }
34:
35: public void writeTo(DataOutputStream out) throws IOException {
36: out.writeLong(low);
37: out.writeLong(high);
38: }
39:
40: public void readFrom(DataInputStream in) throws IOException,
41: IllegalAccessException, InstantiationException {
42: low = in.readLong();
43: high = in.readLong();
44: }
45: }
|