package org.kne.cloud.network.minecraft;

import java.io.IOException;

import org.kne.io.VarDataInputStream;
import org.kne.io.VarDataOutputStream;

public class MinecraftDefaultPacket extends MinecraftPacket {
	private byte[]data;

	public byte[] getData() {
		return data;
	}

	public MinecraftDefaultPacket(int type) {
		super(type );
	}

	@Override
	protected void writeToStream(VarDataOutputStream dto) throws IOException {
		super.writeToStream(dto);
		dto.write(data);
	}

	@Override
	protected void readFromStream(VarDataInputStream din) throws IOException {
		super.readFromStream(din);
		data=din.readAllBytes();
	}

	public MinecraftDefaultPacket( int type, byte[] data) {
		super(type);
		this.data = data;
	}
}
