Hi all,
please see below code...
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class ChracterStreams
{
public static void main(String[] args) throws IOException
{
FileReader in=null;
FileWriter out=null;
try
{
in=new FileReader("E:/Documents and Settings/Naresh/Desktop/java/abc.txt");
out=new FileWriter("E:/Documents and Settings/Naresh/Desktop/java/xyz.txt");
int c;
while((c=in.read())!=-1)
out.write(c);
}
finally
{
if(in!=null)
in.close();
if(out!=null)
out.close();
}
}
}
It successfully writes data from abc.txt to xyz.txt.
but it overwrites data in xyz.txt.
I just want to append new data in abc.txt to the data in xyz.txt.
now what i have to do ?
anyone please tell me....
Thankq very much.