java--io流关闭工具类

import java.io.Closeable;
import java.io.IOException;

public class IOUtils {

	
	public static void close(Closeable ...io){
		for (Closeable closeable : io) {
			if(closeable!=null){
				try {
					closeable.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
}

  

猜你喜欢

转载自www.cnblogs.com/qurui1997/p/10609839.html