 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 TestSetTimeCmd extends TestCommand {

    public long msTime;

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

    public TestSetTimeCmd(long ms) {
	this.seqNo = getNextCmdSeqNo();
	this.len = 12; // for the channelNumber,time,timeout
	this.msTime = ms;
    }
	
    public int getMessageType(){
	return SET_ABSOLUTE_TIME_CMD;
    }

    public void cerealize(DataOutputStream s) throws IOException {
    	super.cerealize(s);
	s.writeLong(msTime);
    }

    public void decerealize(DataInputStream s) throws IOException {
    	super.decerealize(s);
    	msTime = s.readLong();
    }


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

}