private static void createWriter(OutputStream outputStream){
  try {
    closeWriter();
    Writer oWriter=new OutputStreamWriter(outputStream,"UTF-8");
    writer=new BufferedWriter(oWriter);
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
}

private static void createWriter ( OutputStream outputStream ) { try { closeWriter ( ) ; Writer oWriter = new OutputStreamWriter ( outputStream , "UTF-8" ) ; writer = new BufferedWriter ( oWriter ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } }
create a buffered writer given an output stream
