code: public static String readAsString( InputStream stream ) {
  		StringBuilder code = new StringBuilder();
  		try {
  			BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
  			String line;
  			while ((line = reader.readLine()) != null)
  				code.append(line).append(System.lineSeparator());
  			reader.close();
  		} catch (IOException e) {
  			return null;
  //			throw new RuntimeException(e);
  		}
  		String output = code.toString();
  
  		// make windows strings appear the same as linux strings
  		String nl = System.getProperty("line.separator");
  		if( nl.compareTo("\n") != 0 ) {
  			output = output.replaceAll(nl,"\n");
  		}
  
  		return output;
  	}
docs: Reads an entire file and converts it into a text string