 1Content-type: application/x-Unknown; charset=UTF8package nmc.common;

import java.io.DataOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;

public class PollCmd extends Command {
    public int channelNumber;

    public PollCmd(DataInputStream dis) throws IOException {
	this.decerealize(dis);
    }

    public PollCmd(int channelNumber) {
	this.seqNo = getNextCmdSeqNo();
	this.len = 4; // for the channelNumber
	this.channelNumber = channelNumber;
    }
	
    public int getMessageType(){
	return POLL_CMD;
    }

    public void cerealize(DataOutputStream s) throws IOException {
    	super.cerealize(s);
	s.writeInt(channelNumber);
    }

    public void decerealize(DataInputStream s) throws IOException {
    	super.decerealize(s);
    	channelNumber = s.readInt();
    }


    public String toString(){
	return "%<%msgType=PollCmd%seqNo="
	       + this.seqNo
	       + "%len="
	       + this.len
	       + "%channelNumber="
	       + this.channelNumber
	       + "%>%";
    }

}
