package com.soar.stream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.omg.Messaging.SyncScopeHelper;
public class Demo9_TryFinally {
public static void main(String[] args) throws IOException {
try(
FileInputStream fis = new FileInputStream("xxx.txt");
FileOutputStream fos = new FileOutputStream("yyy.txt");
MyClose mc = new MyClose();
){
int b;
while((b = fis.read()) != -1){
System.out.println(b);
}
}
}
}
class MyClose implements AutoCloseable{
public void close(){
System.out.println("我关了");
}
}