Last active
September 25, 2015 01:10
-
-
Save fpereira1/bca6f0e62dbe43a75faa to your computer and use it in GitHub Desktop.
Testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class CopyFile { | |
public static void main(String args[]) throws IOException | |
{ | |
FileInputStream in = null; | |
FileOutputStream out = null; | |
try { | |
in = new FileInputStream("input.txt"); | |
out = new FileOutputStream("output.txt"); | |
int c; | |
while ((c = in.read()) != -1) { | |
out.write(c); | |
} | |
}finally { | |
if (in != null) { | |
in.close(); | |
} | |
if (out != null) { | |
out.close(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment