package org.kne.cloud.network.klalb;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Inet6Address;

public class KLALBOutputStream extends DataOutputStream {

	public KLALBOutputStream(OutputStream out) throws IOException {
		super(out);
		byte[]b=new byte[] {'K','L','A','L','B'};
		write(b);
		writeInt(2);
		writeInt(1);
		flush();
	}
	public void writePacket(KLALBPacket klb) throws IOException {
		writeKLALBPacketToStream(this, klb);
	}
	public static void writeKLALBPacketToStream(DataOutputStream out,KLALBPacket klb) throws IOException {
		out.write(klb.getType());
		klb.writeToStream(out);
		out.flush();
	}
}
