日期:2014-05-20 浏览次数:20717 次
class Test {
public static void main(String args[]) {
FileInputStream fis = null;
FileOutputStream fos = null;
byte[] buffer = new byte[100];
int temp = 0;
try {
fis = new FileInputStream("D:\\aa.txt");
fos = new FileOutputStream("E:\\aa.txt");
while (true) {
temp = fis.read(buffer, 0, buffer.length);
if (temp == -1) {
break;
}
fos.write(buffer, 0, temp);
}
} catch (Exception e) {
System.out.println(e);
} finally {
try {
fis.close();
fos.close();
} catch (Exception e2) {
System.out.println(e2);
}
}
}
}