package com.mstf.scme.test2;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class IO {
public static void main(String[] args) {
FileReader fd=null;
FileWriter fw=null;
try {
fd=new FileReader("E://111.txt");
fw=new FileWriter("E://222.txt");
int data;
while ((data=fd.read())!=-1) {
fw.write(data);
}
} catch (FileNotFoundException e) {
// TODO: handle exception
e.printStackTrace();
}catch (IOException e) {
// TODO: handle exception
e.printStackTrace();
}finally{
try {
if (fd!=null) {
fd.close();
}if (fw!=null) {
fw.close();
}
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
}
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class IO {
public static void main(String[] args) {
FileReader fd=null;
FileWriter fw=null;
try {
fd=new FileReader("E://111.txt");
fw=new FileWriter("E://222.txt");
int data;
while ((data=fd.read())!=-1) {
fw.write(data);
}
} catch (FileNotFoundException e) {
// TODO: handle exception
e.printStackTrace();
}catch (IOException e) {
// TODO: handle exception
e.printStackTrace();
}finally{
try {
if (fd!=null) {
fd.close();
}if (fw!=null) {
fw.close();
}
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
}