package org.kne.cloud.network.klalb;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class PINGPacket extends KLALBPacket {

	private long time;

	@Override
	protected void writeToStream(DataOutput dto) throws IOException {
		super.writeToStream(dto);
		dto.writeLong(time);
	}

	public long getTime() {
		return time;
	}

	@Override
	protected void readFromStream(DataInput din) throws IOException {
		super.readFromStream(din);
		time=din.readLong();
	}

	@Override
	public long getLength() {
		return super.getLength()+8;
	}

	public PINGPacket() {
		super(PING);
	}
	public PINGPacket(long time) {
		super(PING);
		this.time=time;
	}
	@Override
	public String toString() {
		return "PING";
	}

}
