CODE:
import java.io.*;
class BuffereClass
{
public static void main(String args[]) throws IOException
{
int ch;
System.out.println("\nStart Coping...");
FileInputStream fin = new FileInputStream("File1.txt");
BufferedInputStream bfin = new BufferedInputStream(fin);
FileOutputStream fout = new FileOutputStream("File2.txt");
BufferedOutputStream bfout = new BufferedOutputStream(fout);
while((ch=bfin.read()) != -1)
bfout.write(ch);
System.out.println("\nNew File Cretaed and save data.");
bfin.close();
bfout.close();
}
}
OUTPUT :
import java.io.*;
class BuffereClass
{
public static void main(String args[]) throws IOException
{
int ch;
System.out.println("\nStart Coping...");
FileInputStream fin = new FileInputStream("File1.txt");
BufferedInputStream bfin = new BufferedInputStream(fin);
FileOutputStream fout = new FileOutputStream("File2.txt");
BufferedOutputStream bfout = new BufferedOutputStream(fout);
while((ch=bfin.read()) != -1)
bfout.write(ch);
System.out.println("\nNew File Cretaed and save data.");
bfin.close();
bfout.close();
}
}
OUTPUT :
Nice one brother thanks.
ReplyDelete