public char read () throws IOException
	{
		while (true)
		{
			int c = In.read();
			if (c == -1 || c == 255 && lastcommand == 255)
			{
				Dump.println("Received character " + c);
				throw new IOException();
			}
			lastcommand = c;
			if (c == 10)
			{
				if (lastcr == 13)
				{
					lastcr = 0;
					continue;
				}
				lastcr = 10;
				return '\n';
			}
			else if (c == 13)
			{
				if (lastcr == 10)
				{
					lastcr = 0;
					continue;
				}
				lastcr = 13;
				return '\n';
			}
			else lastcr = 0;
			return (char)c;
		}
	}