Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
- }
- }
- }
- }
- import java.io.*;
- public class CopyFile {
- public static void main(String args[]) throws IOException {
- FileReader in = null;
- FileWriter out = null;
- try {
- in = new FileReader("input.txt");
- out = new FileWriter("output.txt");
- int c;
- while ((c = in.read()) != -1) {
- out.write(c);
- }
- }finally {
- if (in != null) {
- in.close();
- }
- if (out != null) {
- out.close();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement