com.penglecode.common.util.IOUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons Show documentation
Show all versions of commons Show documentation
commons is a little java tool to make your development easier in your work.
The newest version!
package com.penglecode.common.util;
import java.io.Closeable;
import java.io.IOException;
/**
* I/O流的相关工具类
*
* @author pengpeng
* @date 2014年7月20日 上午12:33:00
* @version 1.0
*/
public class IOUtils {
/**
* 关闭流(不抛异常)
*
* @param closeable
*/
public static void closeQuietly(Closeable closeable) {
try {
if (closeable != null) {
closeable.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 关闭流
*
* @param closeable
* @throws IOException
*/
public static void close(Closeable closeable) throws IOException {
if (closeable != null) {
closeable.close();
}
}
}