Here you can find the source of getOutputStreamWriter(OutputStream out)
Parameter | Description |
---|---|
out | the output stream to wrap |
public static Writer getOutputStreamWriter(OutputStream out)
//package com.java2s; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; public class Main { /**/* w ww . j av a2s .c o m*/ * Returns a writer for the specified output stream, using UTF-8 encoding. * @param out the output stream to wrap * @return a writer for this output stream */ 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 } } }