public static void write(String in,OutputStream out,boolean closeBoth) throws IOException {
  ByteArrayInputStream is=new ByteArrayInputStream(in.getBytes("UTF-8"));
  write(is,out,closeBoth);
}

public static void write ( String in , OutputStream out , boolean closeBoth ) throws IOException { ByteArrayInputStream is = new ByteArrayInputStream ( in . getBytes ( "UTF-8" ) ) ; write ( is , out , closeBoth ) ; }
writes the input stream to the output stream . closes both if desired .
