import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class EscribirArchivo {

  public static void main(String [] args) {
       FileOutputStream out;//abrir el archivo
       try {
        out = new FileOutputStream( "d:\\gus\\gus2.txt");
        int c=65;
        try {//cerrar archivo
           for (int i =0;i<30;i++) {
             out.write(c+i);
           }            
           out.close();
        } catch (IOException ex) {
            ex.printStackTrace();
            System.exit(0);
         }//try
       } catch ( FileNotFoundException ex) {
          ex.printStackTrace();
          System.exit(0);
       }//try
       
  }//main

}//LeerArchivo