 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 WakeupCmd extends Command {
    public long absoluteTime;

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

    public WakeupCmd(long absoluteTime) {
	this.seqNo = getNextCmdSeqNo();
	this.len = 8; // for the absoluteTime
	this.absoluteTime = absoluteTime;
    }
	
    public int getMessageType(){
	return WAKEUP_CMD;
    }

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

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

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