private String readString() throws IOException, NoOutputException { StringBuilder line = new StringBuilder(); while (true) { String subline = processOut.readLine(); if (subline == null) { StringBuilder errorMessage = new StringBuilder(); errorMessage.append("Pipe to subprocess seems to be broken!"); if (line.length() == 0) { errorMessage.append(" No output read.\n"); } else { errorMessage.append(" Currently read output: " + line.toString() + "\n"); } errorMessage.append("Serializer Exception:\n"); throw new NoOutputException(errorMessage.toString()); } if (subline.equals("end")) { break; } if (line.length() != 0) { line.append("\n"); } line.append(subline); } return line.toString(); } }
private String readString() throws IOException, NoOutputException { StringBuilder line = new StringBuilder(); while (true) { String subline = processOut.readLine(); if (subline == null) { StringBuilder errorMessage = new StringBuilder(); errorMessage.append("Pipe to subprocess seems to be broken!"); if (line.length() == 0) { errorMessage.append(" No output read.\n"); } else { errorMessage.append(" Currently read output: " + line.toString() + "\n"); } errorMessage.append("Serializer Exception:\n"); throw new NoOutputException(errorMessage.toString()); } if (subline.equals("end")) { break; } if (line.length() != 0) { line.append("\n"); } line.append(subline); } return line.toString(); } }