private void printProperties(Properties properties) throws IOException {
  StringWriter stringBuffer=new StringWriter();
  BufferedReader reader=null;
  properties.store(stringBuffer,null);
  try {
    reader=new BufferedReader(new StringReader(stringBuffer.toString()));
    reader.readLine();
    String line=null;
    while ((line=reader.readLine()) != null) {
      writer.print("//");
      writer.println(line);
    }
  }
  finally {
    if (reader != null) {
      reader.close();
    }
  }
}

private void printProperties ( Properties properties ) throws IOException { StringWriter stringBuffer = new StringWriter ( ) ; BufferedReader reader = null ; properties . store ( stringBuffer , null ) ; try { reader = new BufferedReader ( new StringReader ( stringBuffer . toString ( ) ) ) ; reader . readLine ( ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { writer . print ( "//" ) ; writer . println ( line ) ; } } finally { if ( reader != null ) { reader . close ( ) ; } } }
prints the properties to the result file . this uses a roundabout way to store properties , but using java ' s underlying encoding mechanism ensures unicode and special characters are escaped correctly .
