how to create a backup file
import java.io.*;
class BakFileCreator
{
public static void main(String args[]) throws FileNotFoundException,IOException
{
FileInputStream fis=new FileInputStream(args[0]);
FileOutputStream fos=new FileOutputStream(args[0]+".bak");
int data;
while((data=fis.read())!=-1)
{
fos.write(data);
}
System.out.println("backup file is success fully created");
}//main
}//class
output
import java.io.*;
class BakFileCreator
{
public static void main(String args[]) throws FileNotFoundException,IOException
{
FileInputStream fis=new FileInputStream(args[0]);
FileOutputStream fos=new FileOutputStream(args[0]+".bak");
int data;
while((data=fis.read())!=-1)
{
fos.write(data);
}
System.out.println("backup file is success fully created");
}//main
}//class
output
No comments:
Post a Comment