code: public static String loadText(InputStream in) throws IOException {
          StringBuilder builder = new StringBuilder();
          InputStreamReader isr = new InputStreamReader(in);
          try {
              BufferedReader reader = new BufferedReader(isr);
              while (true) {
                  String line = reader.readLine();
                  if (line != null) {
                      builder.append(line);
                      builder.append("\n");
                  } else {
                      break;
                  }
              }
              return builder.toString();
          } finally {
              try {
                  isr.close();
              } catch (Exception e) {
                  // ignore
              }
              try {
                  in.close();
              } catch (Exception e) {
                  // ignore
              }
          }
      }
docs: Loads the entire stream into memory as a String and returns it.
  <p/>
  <b>Notice:</b> This implementation appends a <tt>\n</tt> as line
  terminator at the of the text.
  <p/>
  Warning, don't use for crazy big streams :)