package cn.weida.io.others;
import java.io.Closeable;
import java.io.IOException;
import java.io.IOException;
public class fileCloseUtils {
/**
* 工具关闭类
* 可变参数 形参最后
*
*fileCloseUtils.close(i,s,x);
* @param io
*/
public static void close(Closeable ... io) {
for(Closeable temp: io) {
try {
if (null != temp)
temp.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
*
* @param io
*/
public static <T extends Closeable> void closeAll(T ... io) {
for(Closeable temp: io) {
try {
if (null != temp)
temp.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* 工具关闭类
* 可变参数 形参最后
*
*fileCloseUtils.close(i,s,x);
* @param io
*/
public static void close(Closeable ... io) {
for(Closeable temp: io) {
try {
if (null != temp)
temp.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
*
* @param io
*/
public static <T extends Closeable> void closeAll(T ... io) {
for(Closeable temp: io) {
try {
if (null != temp)
temp.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}