@Override
	public synchronized int read() throws IOException {
		if (in == null) {
			if ((in = nextLine()) == null) {
				return -1;
			}
		} else if (in.available() <= 0) {
			try {
				return -1;
			} finally {
				in = null;
			}
		}
		return in != null ? in.read() : -1;
	}