Re: file handlilng in java
Posted By:
dtr_prasad
Posted On:
Thursday, January 12, 2006 10:07 AM
use new FileOutputStream("myfile.txt",true) constructor while writing.
else use nio channels to read into ByteBuffer and appending content ,create a new channel(with file name for FileOutputStream)and write this ByteBuffer and force it.
checked exceptions like file existence/EOF are to be handled in catch block and with loop
int c;
while((c=in.read())!=-1)
{
...manipulate c....
}