对比新文件 |
| | |
| | | package com.iailab.framework.common.util.io; |
| | | |
| | | import cn.hutool.core.io.IORuntimeException; |
| | | import cn.hutool.core.io.IoUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | |
| | | import java.io.InputStream; |
| | | |
| | | /** |
| | | * IO 工具类,用于 {@link cn.hutool.core.io.IoUtil} 缺失的方法 |
| | | * |
| | | * @author iailab |
| | | */ |
| | | public class IoUtils { |
| | | |
| | | /** |
| | | * 从流中读取 UTF8 编码的内容 |
| | | * |
| | | * @param in 输入流 |
| | | * @param isClose 是否关闭 |
| | | * @return 内容 |
| | | * @throws IORuntimeException IO 异常 |
| | | */ |
| | | public static String readUtf8(InputStream in, boolean isClose) throws IORuntimeException { |
| | | return StrUtil.utf8Str(IoUtil.read(in, isClose)); |
| | | } |
| | | |
| | | } |