package org.kne.cloud.network.minecraft;

import java.io.IOException;

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

public class MinecraftUnsolvedPacket extends MinecraftPacket{
	private byte[]data;
	public byte[] getData() {
		return data;
	}
	public int getLenth() {
		return length;
	}
	public MinecraftUnsolvedPacket( ) {
		super(false);
		this.data = new byte[8192];
		this.length = data.length;
		
	}
	public MinecraftUnsolvedPacket( byte[] data, int length) {
		super(false);
		this.data = data;
		this.length = length;
	}
	private int length;
	@Override
	protected void writeToStream(VarDataOutputStream dto) throws IOException {
		super.writeToStream(dto);
		dto.write(data, 0, length);
	}
	@Override
	protected void readFromStream(VarDataInputStream din) throws IOException {
		super.readFromStream(din);
		length=din.read(data);
	}

}
