/** * Writes the configuration data from the <code>Dictionary</code> to the * given <code>OutputStream</code>. * <p> * This method writes at the current location in the stream and does not * close the outputstream. * * @param out * The <code>OutputStream</code> to write the configurtion data * to. * @param properties * The <code>Dictionary</code> to write. * @throws IOException * If an error occurrs writing to the output stream. */ public static void write( OutputStream out, Dictionary properties ) throws IOException { BufferedWriter bw = new BufferedWriter( new OutputStreamWriter( out, ENCODING ) ); for ( Enumeration ce = orderedKeys(properties); ce.hasMoreElements(); ) { String key = ( String ) ce.nextElement(); // cfg = prop "=" value "." . writeQuoted( bw, key ); bw.write( TOKEN_EQ ); writeValue( bw, properties.get( key ) ); bw.write( CRLF ); } bw.flush(); }
/** * Writes the configuration data from the <code>Dictionary</code> to the * given <code>OutputStream</code>. * <p> * This method writes at the current location in the stream and does not * close the outputstream. * * @param out * The <code>OutputStream</code> to write the configurtion data * to. * @param properties * The <code>Dictionary</code> to write. * @throws IOException * If an error occurrs writing to the output stream. */ public static void write( OutputStream out, Dictionary properties ) throws IOException { BufferedWriter bw = new BufferedWriter( new OutputStreamWriter( out, ENCODING ) ); for ( Enumeration ce = orderedKeys(properties); ce.hasMoreElements(); ) { String key = ( String ) ce.nextElement(); // cfg = prop "=" value "." . writeQuoted( bw, key ); bw.write( TOKEN_EQ ); writeValue( bw, properties.get( key ) ); bw.write( CRLF ); } bw.flush(); }
/** * Writes the configuration data from the <code>Dictionary</code> to the * given <code>OutputStream</code>. * <p> * This method writes at the current location in the stream and does not * close the outputstream. * * @param out * The <code>OutputStream</code> to write the configurtion data * to. * @param properties * The <code>Dictionary</code> to write. * @throws IOException * If an error occurrs writing to the output stream. */ public static void write( OutputStream out, Dictionary properties ) throws IOException { BufferedWriter bw = new BufferedWriter( new OutputStreamWriter( out, ENCODING ) ); for ( Enumeration ce = orderedKeys(properties); ce.hasMoreElements(); ) { String key = ( String ) ce.nextElement(); // cfg = prop "=" value "." . writeQuoted( bw, key ); bw.write( TOKEN_EQ ); writeValue( bw, properties.get( key ) ); bw.write( CRLF ); } bw.flush(); }