out.write(sc.getBytes());
for (int x = 0; x < sc.length(); x++) out.write(sc.charAt(x));
   private void writeToFile(String sc,File file) {      FileOutputStream out = null;      try {         out = new FileOutputStream(file);         out.write(sc.getBytes());         out.flush();         out.close();      }      catch (FileNotFoundException fnfe) {System.out.println("fnfe: " + fnfe.getMessage());}      catch (IOException ioe) {System.out.println("ioe: " + ioe.getMessage());}      finally {         if (out != null)            try {               out.close();            }            catch (IOException exc) {}      }   }