A
Arun Kumar Srinivasan
Hi,
I am writing a program that generates a reasonably large result in
HTML format. The result is stored in the variable htmlContent which is
a StringBuffer object. Using "text/html" content type, the contents of
this variable is depicted on a JTextPane. There is a "Write to File"
button that allows the user to write the HTML data to a file. The code
for this is
// Code snippet Starts here
setOutput(); // Gets the File fName where the user
wants to write the file
if (fName!=null)
try {
FileWriter oWrite=new FileWriter(fName);
oWrite.write(htmlContent.toString());
}
catch (Exception e)
{
e.printStackTrace();
FrmMain.displayError(e.toString());
}
// Code snippet ends here
What happens is that after about 17000 characters, the file ends
abruptly. The result is that one table and a portion of another are
missing from the file. Can anyone please tell me what might be the
problem? I dont think there is any memroy problem because I had about
113 MB free during execution. Could there be some other restriction I
am not aware of? I once was able to write a HTML file with 77000+
characters through similar method (not sure if I used FileWriter
though). Please help.
Thanks in advance,
Arun Kumar Srinivasan
I am writing a program that generates a reasonably large result in
HTML format. The result is stored in the variable htmlContent which is
a StringBuffer object. Using "text/html" content type, the contents of
this variable is depicted on a JTextPane. There is a "Write to File"
button that allows the user to write the HTML data to a file. The code
for this is
// Code snippet Starts here
setOutput(); // Gets the File fName where the user
wants to write the file
if (fName!=null)
try {
FileWriter oWrite=new FileWriter(fName);
oWrite.write(htmlContent.toString());
}
catch (Exception e)
{
e.printStackTrace();
FrmMain.displayError(e.toString());
}
// Code snippet ends here
What happens is that after about 17000 characters, the file ends
abruptly. The result is that one table and a portion of another are
missing from the file. Can anyone please tell me what might be the
problem? I dont think there is any memroy problem because I had about
113 MB free during execution. Could there be some other restriction I
am not aware of? I once was able to write a HTML file with 77000+
characters through similar method (not sure if I used FileWriter
though). Please help.
Thanks in advance,
Arun Kumar Srinivasan