code: public static String readOutput(BufferedReader in) throws IOException {
          StringBuffer output = new StringBuffer();
          String line = "";
          while ((line = in.readLine()) != null) {
              output.append(line);
              output.append("\n");
          }
          return output.toString();
      }
docs: Reads the output of the reader and delivers it at string.