public synchronized void save(OutputStream output,String Header) throws IOException {
  if (output != null) {
    PrintWriter theWrtr=new PrintWriter(output);
    if (Header != null) {
      theWrtr.println(Header);
    }
    Enumeration theKeys=keys();
    while (theKeys.hasMoreElements()) {
      String key=(String)theKeys.nextElement();
      Object value=get((Object)key);
      if (value != null) {
        if (value instanceof String) {
          StringBuffer currentOutput=new StringBuffer();
          currentOutput.append(key);
          currentOutput.append("=");
          currentOutput.append((String)value);
          theWrtr.println(currentOutput.toString());
        }
 else         if (value instanceof Vector) {
          Vector values=(Vector)value;
          Enumeration valuesEnum=values.elements();
          while (valuesEnum.hasMoreElements()) {
            String currentElement=(String)valuesEnum.nextElement();
            StringBuffer currentOutput=new StringBuffer();
            currentOutput.append(key);
            currentOutput.append("=");
            currentOutput.append(currentElement);
            theWrtr.println(currentOutput.toString());
          }
        }
      }
      theWrtr.println();
      theWrtr.flush();
    }
  }
}

public synchronized void save ( OutputStream output , String Header ) throws IOException { if ( output != null ) { PrintWriter theWrtr = new PrintWriter ( output ) ; if ( Header != null ) { theWrtr . println ( Header ) ; } Enumeration theKeys = keys ( ) ; while ( theKeys . hasMoreElements ( ) ) { String key = ( String ) theKeys . nextElement ( ) ; Object value = get ( ( Object ) key ) ; if ( value != null ) { if ( value instanceof String ) { StringBuffer currentOutput = new StringBuffer ( ) ; currentOutput . append ( key ) ; currentOutput . append ( "=" ) ; currentOutput . append ( ( String ) value ) ; theWrtr . println ( currentOutput . toString ( ) ) ; } else if ( value instanceof Vector ) { Vector values = ( Vector ) value ; Enumeration valuesEnum = values . elements ( ) ; while ( valuesEnum . hasMoreElements ( ) ) { String currentElement = ( String ) valuesEnum . nextElement ( ) ; StringBuffer currentOutput = new StringBuffer ( ) ; currentOutput . append ( key ) ; currentOutput . append ( "=" ) ; currentOutput . append ( currentElement ) ; theWrtr . println ( currentOutput . toString ( ) ) ; } } } theWrtr . println ( ) ; theWrtr . flush ( ) ; } } }
save the properties to the given outputstream .
