synchronized public static void toFile(String context,String fileName,boolean append) throws IOException {
  PrintStream ps=new PrintStream(new FileOutputStream(fileName,append));
  ps.println(context);
  ps.flush();
  ps.close();
}

synchronized public static void toFile ( String context , String fileName , boolean append ) throws IOException { PrintStream ps = new PrintStream ( new FileOutputStream ( fileName , append ) ) ; ps . println ( context ) ; ps . flush ( ) ; ps . close ( ) ; }
writes desired string data to appropriate file .
