Commit 61c8d97a by 墨竹

fix:关闭连接

parent fa8f4662
......@@ -23,11 +23,8 @@ public class CommonUtil {
* @return
*/
public static byte[] getFileByte(String url) {
try {
InputStream in = new URL(url).openStream();
byte[] data = IOUtils.toByteArray(in);
return data;
try (InputStream in = new URL(url).openStream()) {
return IOUtils.toByteArray(in);
} catch (Exception e) {
logger.info("【异常】" + e.getMessage(), e);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment