package streamer;

public class Request {
	String host;
	int port;
	int size;
	int delay;
	boolean paired;

	public Request(byte[] bs) {
		//System.out.println(new String(bs));
		java.util.StringTokenizer st =
			new java.util.StringTokenizer((new String(bs)), ";");

		st.nextToken(); //Request type
		setHost(st.nextToken());
		setPort((new Integer(st.nextToken())).intValue());
		setSize((new Integer(st.nextToken())).intValue());
		setDelay((new Integer(st.nextToken())).intValue());
		if (st.nextToken().equals("true"))
			setPaired(true);
		else
			setPaired(false);

	}

	public int getDelay() {
		return delay;
	}

	public String getHost() {
		return host;
	}

	public boolean isPaired() {
		return paired;
	}

	public int getPort() {
		return port;
	}

	public int getSize() {
		return size;
	}

	private void setDelay(int i) {
		delay = i;
	}

	private void setHost(String string) {
		host = string;
	}

	private void setPaired(boolean b) {
		paired = b;
	}

	private void setPort(int i) {
		port = i;
	}

	private void setSize(int i) {
		size = i;
	}

}
