This code contains simple logic of copy paste of a file content
import java.io.*;
public class FileMain
{
public static void main(String []args) throws IOException
{
FileInputStream f1= new FileInputStream("/give_file_name.txt");// creats an input stream which points a file
OutputStream f2= new FileOutputStream("/a.txt");// creats out put stream int i= f1.available();// checks sise of the file
// System.out.println(i);
for(int q=0;q<=i;q++ )
{
f2.write((char)f1.read());
}
}
}