public static void storeSorted(Properties props, OutputStream os, String header) throws IOException { PrintStream ps = new PrintStream(os); SortedMap propMap = new TreeMap(); propMap.putAll(props); ps.println("#" + header); Iterator it = propMap.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry)it.next(); ps.println(entry.getKey() + " = " + entry.getValue()); } ps.flush();
public static void storeSorted(OutputStream os) throws IOException { storeSorted(settings, os);
  public static void storeSorted(Properties props,				 OutputStream os, String header)    throws IOException {    PrintStream ps = new PrintStream(os);    SortedMap propMap = new TreeMap();    propMap.putAll(props);    ps.println("#" + header);    Iterator it = propMap.entrySet().iterator();    while (it.hasNext()) {      Map.Entry entry = (Map.Entry)it.next();      ps.println(entry.getKey() + " = " + entry.getValue());    }    ps.flush();  }