|
|
@@ -138,15 +138,18 @@ public class HttpUtils {
|
|
|
if(null == in){
|
|
|
return;
|
|
|
}
|
|
|
- log.debug(" ++ {}", filePath);
|
|
|
- byte[] byteArray = inputStream2ByteArray(in);
|
|
|
log.debug(" -- {}", url);
|
|
|
File file = new File(filePath);
|
|
|
+ byte[] bytes = new byte[40960];
|
|
|
+ int len;
|
|
|
try (FileOutputStream os = new FileOutputStream(file, true)){
|
|
|
- os.write(byteArray, 0, byteArray.length);
|
|
|
+ while ((len = in.read(bytes)) != -1) {
|
|
|
+ os.write(bytes, 0, len);
|
|
|
+ }
|
|
|
} catch (IOException e) {
|
|
|
log.error("下载出错 : {}", url);
|
|
|
}
|
|
|
+ log.debug(" ++ {}", filePath);
|
|
|
}
|
|
|
|
|
|
/**
|