private String readString() throws IOException {
        StringBuilder line = new StringBuilder();

        // synchronized (processOut) {
        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("Shell Process Exception:\n");
                errorMessage.append(getErrorsString() + "\n");
                throw new RuntimeException(errorMessage.toString());
            }
            if (subline.equals("end")) {
                break;
            }
            if (line.length() != 0) {
                line.append("\n");
            }
            line.append(subline);
        }
        // }

        return line.toString();
    }