public void demo()
throws FileNotFoundException, IOException {
FileInputStream fis =
null;
FileOutputStream fos =
null;
try {
fis =
new FileInputStream(
"a.txt");
fos =
new FileOutputStream(
"b.txt");
byte[] arr =
new byte[
1024*
8];
int len;
while((len = fis.read(arr)) != -
1) {
fos.write(arr,
0,len);
}
}
finally {
try{
if(fis !=
null)
fis.close();
}
finally {
if(fos !=
null)
fos.close();
}
}
}
转载请注明原文地址: https://ju.6miu.com/read-950285.html