1 package com.maverick.multiplex; 2 3 import java.io.IOException ; 4 5 import com.maverick.util.ByteArrayWriter; 6 7 public class Request { 8 9 byte[] requestData; 10 String requestName; 11 12 public Request(String requestName) { 13 this(requestName, (byte[]) null); 14 } 15 16 public Request(String requestName, byte[] requestData) { 17 this.requestName = requestName; 18 this.requestData = requestData; 19 } 20 21 public Request(String requestName, Object [] values) throws IOException { 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 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 |