code: static public InputStream replaceProperties(InputStream source, Properties props, String startStr, String endStr) throws IOException, SubstitutionException {
  	String template = streamToString(source);
  	String replaced = StringUtil.substituteWithProperties(template, startStr, endStr, props);
  	System.err.println(template);
  	System.err.println(replaced);
  	return new ByteArrayInputStream(replaced.getBytes());
      }
docs: Creates an InputStream containing the document resulting from replacing template
  parameters in the given InputStream source.
  @param source The source stream
  @param props The properties
  @param startStr The String that marks the start of a replacement key such as "${"
  @param endStr The String that marks the end of a replacement key such as "}"
  @return An InputStream containing the resulting document.