public void queueBytes(int len, byte buf[]) throws IOException {
		if (closed) {
			return;
		}
		if (hasIOError) {
			hasIOError = false;
			throw new IOException("Error in writer thread");
		}
		if (buffer == null) {
			buffer = new byte[5000];
		}
		synchronized (this) {
			for (int l = 0; l < len; l++) {
				buffer[buffIndex] = buf[l];
				buffIndex = (buffIndex + 1) % 5000;
				if (buffIndex == (writeIndex + 4900) % 5000) {
					throw new IOException("buffer overflow");
				}
			}
			if (!isWriter) {
				isWriter = true;
				rsApplet.startRunnable(this, 3);
			}
			notify();
		}
	}