All pastes #85615 Raw Edit

Something

public text v1 · immutable
·published 2006-07-12 02:08 UTC
rendered paste body
public String getServerResponse() throws IOException, InterruptedException {
		StringBuilder builder = new StringBuilder();
		BufferedReader reader = new BufferedReader(fromServer);

		String line = "";
		int count = 0;

		while(true) {
			if (line.contains(TERMINATOR)) {
				if (++count > 1){
					break;
				}
			}
			line = reader.readLine();
			builder.append(line).append("n");

		}
		return builder.toString().replaceAll(lastCommand, "").replaceAll(TERMINATOR, "");
	}