You are on page 1of 1

import java.io.

*;
class Demo
{
public static void main(String arv[])
throws IOException
{
FileInputStream fin = null;
FileOutputStream fout = null;
int i;
try {
fin = new FileInputStream("in.txt"); fout = new FileOutputStream("out.txt");
while((i = fin.read())!=-1)
fout.write(i);
}
catch(IOException e)
{
System.out.println(e);
}
finally
{
if(fin!=null) fin.close();
if(fout!=null)
fout.close();
}
}
}

You might also like