KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > maverick > multiplex > Packet


1 package com.maverick.multiplex;
2
3 import java.io.IOException JavaDoc;
4
5 import com.maverick.util.ByteArrayWriter;
6
7 /**
8  * <p>Title: </p>
9  *
10  * <p>Description: </p>
11  *
12  * <p>Copyright: Copyright (c) 2005</p>
13  *
14  * <p>Company: </p>
15  *
16  * @author not attributable
17  */

18 public class Packet extends ByteArrayWriter {
19
20     public Packet() throws IOException JavaDoc {
21         writeInt(0);
22     }
23
24     public void prepare() {
25        encodeInt(buf, 0, size() - 4);
26     }
27     
28     public void reset() {
29         super.reset();
30         try {
31             writeInt(0);
32         } catch (IOException JavaDoc e) {
33         }
34     }
35 }
36
Popular Tags