Hi,
I created a file by using fileWriter with true. I am able to write a string into that file. and close it. When I go again to merge my second string to the file, it is not writing basically . I got the "stream closed" exception.
I did not use any stream classes. I used a fileWriter class only. If we cannot close fileWriter object the string is not writing into the file, so we have to close the fileWriter object. if we close, how to open again?
FileWriter fw = new FileWriter(name,true); //I created this //object in different class.
I called the above object in another class.
String s= "how are you"; //here every time I am creating a //new string
fw1.write(s);
fw1.close(); //if we donot use this, the string is not //writing.
When I create another string and write into that file it is giving exception " stream closed"
How do I do this one.
thanks for your help,
I created a file by using fileWriter with true. I am able to write a string into that file. and close it. When I go again to merge my second string to the file, it is not writing basically . I got the "stream closed" exception.
I did not use any stream classes. I used a fileWriter class only. If we cannot close fileWriter object the string is not writing into the file, so we have to close the fileWriter object. if we close, how to open again?
FileWriter fw = new FileWriter(name,true); //I created this //object in different class.
I called the above object in another class.
String s= "how are you"; //here every time I am creating a //new string
fw1.write(s);
fw1.close(); //if we donot use this, the string is not //writing.
When I create another string and write into that file it is giving exception " stream closed"
How do I do this one.
thanks for your help,