@Override
	public void run()
	{
		try
		{
			inputStream = new DataInputStream(new BufferedInputStream(socket.getInputStream()));
			outputStream = new DataOutputStream(new BufferedOutputStream( socket.getOutputStream()));

			while (inputStream.available() != -1)
			{
				System.out.println();
				int packetSize = inputStream.readShort();
				byte packetBuffer[] = new byte[packetSize];
				int byteRecieve = 0;
				while (byteRecieve < packetSize)
				{
					inputStream.read(packetBuffer, byteRecieve, 1);
					byteRecieve++;
				}
				recievePacket(packetBuffer);
			}


		} catch (IOException e)
		{
			debug("ERROR");
			//e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
		}
	}