Tema: PrintWriter
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/02/2010, 04:56
Crisap
 
Fecha de Ingreso: octubre-2007
Mensajes: 5
Antigüedad: 17 años, 5 meses
Puntos: 0
Exclamación PrintWriter

Hola, tengo un problemilla que no encuentro solución...

He implementado un método el cual escribe en un archivo 'inputTxtFile' un determinado texo. (parte del código lo pongo a continuación)

Mi pregunta es, hay un máximo de líneas que se puedan escribir en un archivo utilizando PrintWriter??????????
Cuando ejecuto este código con la mitad de las líneas htmlPrintWriter.println("...") que necesito se ejecuta correctamente, pero cuando lo pongo todo no...

Alguien puede ayudarme????????????????

Cita:
public void copiaTextoEnArchivo(String inputTxtFile){
String s;
try{
File txtFile = new File(inputTxtFile);
File htmlFile = new File(inputTxtFile);//+".html");
FileReader txtFileReader = new FileReader(txtFile);
BufferedReader txtBuffReader = new BufferedReader(txtFileReader);
PrintWriter htmlPrintWriter = new PrintWriter(htmlFile);


htmlPrintWriter.println("<html xmlns='http://www.w3.org/1999/xhtml'>");
htmlPrintWriter.println("<head>");
.......................
.......................
.......................
htmlPrintWriter.println(" </head>");
htmlPrintWriter.println(" <body onload='initialize()' onunload='GUnload()' bgcolor='#6699FF'>");
htmlPrintWriter.println(" <div id='map_canvas' style= 'width:750px; height:600px'> </div>");
htmlPrintWriter.println(" </body>");
htmlPrintWriter.println("</html>");
//Start reading file line by line and write into the html file
while((s=txtBuffReader.readLine())!=null)
{
htmlPrintWriter.println("<h1>"+s);
//htmlPrintWriter.println("<br>");
}
htmlPrintWriter.close();
txtBuffReader.close();
}catch(Exception e){
e.printStackTrace();
}
}