question: 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 ( ) ; } } }
target:  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.