public static void writeProperties(Properties props,OutputStream out,boolean includeDefaults) throws IOException {
  if (includeDefaults) {
    Properties all=new Properties();
    Enumeration<?> propNames=props.propertyNames();
    while (propNames.hasMoreElements()) {
      String propName=(String)propNames.nextElement();
      String propValue=props.getProperty(propName);
      all.put(propName,propValue);
    }
    props=all;
  }
  try {
    props.store(out,null);
  }
  finally {
    out.close();
  }
}

public static void writeProperties ( Properties props , OutputStream out , boolean includeDefaults ) throws IOException { if ( includeDefaults ) { Properties all = new Properties ( ) ; Enumeration < ? > propNames = props . propertyNames ( ) ; while ( propNames . hasMoreElements ( ) ) { String propName = ( String ) propNames . nextElement ( ) ; String propValue = props . getProperty ( propName ) ; all . put ( propName , propValue ) ; } props = all ; } try { props . store ( out , null ) ; } finally { out . close ( ) ; } }
write the specified properties to the specified output stream .
