code: public static String convertStreamToString(InputStream is, String charset) {
  
      	if (is == null) return null;
  
      	StringBuilder sb = new StringBuilder();
          String line;
  
          try {
          	// TODO: Can this be a performance killer if many many lines or is BufferedReader handling that in a good way?
              BufferedReader reader = new BufferedReader(new InputStreamReader(is, charset));
              while ((line = reader.readLine()) != null) {
                  sb.append(line).append("\n");
              }
          } catch (IOException e) {
          	throw new RuntimeException(e);
  		} finally {
  			// Ignore exceptions on call to the close method
              try {is.close();} catch (IOException e) {}
          }
          return SourceFormatterUtil.formatSource(sb.toString());
      }
docs: To convert an InputStream to a String we use the BufferedReader.readLine()
  method. We iterate until the BufferedReader return null which means
  there's no more data to read. Each line will appended to a StringBuilder
  and returned as String.
  
  @param is
  @return