package org.kne.cloud.network.klalb;

import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;

public class PINGPacket extends KLALBPacket {

	private static final int HEADER_LENGTH=25;

	public long getTime() {
		return klalbHeader.getLong(17);
	}

	public long getUpSpeed() {
		return klalbHeader.getLong(1);
	}

	public long getDownSpeed() {
		return klalbHeader.getLong(9);
	}

	public PINGPacket(long time,long upSpeed,long downSpeed) {
		super(PING,HEADER_LENGTH);
		klalbHeader.putLong(upSpeed);
		klalbHeader.putLong(downSpeed);
		klalbHeader.putLong(time);
	}
	public PINGPacket(ByteBuffer bb) {
		super(bb,HEADER_LENGTH);
	}

	@Override
	public String toString() {
		return "PING";
	}

}
