I have read a file in a string, change the first line and then type this string into a new file. I do this through the following code (little bit smaller):
while (jspIterator.hasNext ()) {string line = (string) jspIterator.next (); If (i == 0) {if (line.startsWith ("bla bla") & amp; amp; amp; and line.endsWith ("yada")) {line = line.replaceFirst ("this", "that" ); }} JspAsString + = Row; I ++; } Filer Newsprair = new flumer writer (newspfile); NewJspWriter.write (jspAsString);
Now the files written in this way are either 32, 24, 16, 8 KBAIT big or completely empty. While debugging, I see that the string is collected correctly. When I print the variable jspAsString in the console, it also looks correct.
Do you know why FileWriter behaves like this?
It is possible that you have closed ()
to FileWriter
did not.
Comments
Post a Comment