public static Writer getOutputStreamWriter ( OutputStream out ) { try { return new OutputStreamWriter ( out , "UTF-8" ) ; } catch ( UnsupportedEncodingException ex ) { throw new RuntimeException ( ex ) ; // shouldn't happen since UTF-8 is supported by all JVMs per spec } }
Returns a writer for the specified output stream using UTF - 8 encoding .