优雅写法 Posted on 2022-05-13 | In Android代码片段 工具类优雅关闭流1234567891011121314151617181920import java.io.Closeable;import java.io.IOException;/** * 说明:关闭流的类 * * @author shenbh * time 2021-10-15 15:41 */public class CloseableUtil { public static void close(Closeable closeable){ try { if (closeable != null){ closeable.close(); } } catch (IOException e) { e.printStackTrace(); } }}