@Override
	public int read() throws IOException {
		if (!closed && readChars.isEmpty())
			synchronized (mutex) {
				try {
					mutex.wait();
				} catch (InterruptedException e) {
					throw new IOException(e);
				}
			}

		if (closed)
			return -1;

		return readChars.pollFirst();
	}