@Override
	public String readLine() throws IOException {
		StringBuilder sb = new StringBuilder();
		int intch;

		int c = lineSeps[0];
		int i = 0;
		int len = lineSeps.length;
		synchronized (lock) { // make thread-safe (hopefully!)
			while ((intch = read()) != -1) {
				if (intch == c) {
					i++;
					if (i == len) {
						return sb.substring(0, sb.length() - len + 1);
					}
					c = lineSeps[i];
				}

				sb.append((char) intch);
			}
		}
		String string = sb.toString();
		if (string.length() == 0) { // immediate EOF
			return null;
		}
		return string;
	}