 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 AbsoluteTimeReply extends Reply {
    long      absoluteTime;

    public AbsoluteTimeReply(DataInputStream dis) throws IOException {
        this.decerealize(dis);
    }
    
    public AbsoluteTimeReply(Message m, long absoluteTime) {
	GetAbsoluteTimeCmd origCmd = (GetAbsoluteTimeCmd)m;
    	this.seqNo = origCmd.seqNo;
        this.absoluteTime = absoluteTime;

    	this.len = 8;
    }
    
    public void decerealize(DataInputStream dis) throws IOException {
	super.decerealize(dis);
	this.absoluteTime = dis.readLong();
    }

    public int getMessageType(){
	return ABSOLUTE_TIME_REPLY;
    }
    
    public long getAbsoluteTime() {
        return absoluteTime;
    }

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

        s.writeLong     (absoluteTime);
    }


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


}
