public void run()
	{
		while(isWriter)
		{
			int i;
			int j;
			synchronized(this)
			{
				if(buffIndex == writeIndex)
					try
					{
						wait();
					}
					catch(InterruptedException _ex) { }
				if(!isWriter)
					return;
				j = writeIndex;
				if(buffIndex >= writeIndex)
					i = buffIndex - writeIndex;
				else
					i = 5000 - writeIndex;
			}
			if(i > 0)
			{
				try
				{
					outputStream.write(buffer, j, i);
				}
				catch(IOException _ex)
				{
					hasIOError = true;
				}
				writeIndex = (writeIndex + i) % 5000;
				try
				{
					if(buffIndex == writeIndex)
						outputStream.flush();
				}
				catch(IOException _ex)
				{
					hasIOError = true;
				}
			}
		}
	}