KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.maverick.multiplex;
2
3 import java.io.IOException JavaDoc;
4
5 import com.maverick.util.ByteArrayWriter;
6
7 public class Request {
8
9     byte[] requestData;
10     String JavaDoc requestName;
11     
12     public Request(String JavaDoc requestName) {
13         this(requestName, (byte[]) null);
14     }
15     
16     public Request(String JavaDoc requestName, byte[] requestData) {
17         this.requestName = requestName;
18         this.requestData = requestData;
19     }
20     
21     public Request(String JavaDoc requestName, Object JavaDoc[] values) throws IOException JavaDoc {
22         this.requestName = requestName;
23         ByteArrayWriter writer = new ByteArrayWriter();
24         for (int index = 0; index < values.length; index++) {
25             writer.writeString(values[index].toString());
26         }
27         requestData = writer.toByteArray();
28     }
29     
30     public String JavaDoc getRequestName() {
31         return requestName;
32     }
33     
34     public byte[] getRequestData() {
35         return requestData;
36     }
37     
38     public void setRequestData(byte[] requestData) {
39         this.requestData = requestData;
40     }
41 }
Popular Tags