pull/975/merge
PXLZJ 2 years ago committed by GitHub
commit ac20dc6687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDThreadTaskAdapter.java

@ -165,6 +165,7 @@ final class HttpDThreadTaskAdapter extends BaseHttpThreadTaskAdapter {
fos.write(buffer, 0, len); fos.write(buffer, 0, len);
progress(len); progress(len);
} }
fos.flush();
handleComplete(); handleComplete();
} catch (IOException e) { } catch (IOException e) {
fail(new AriaHTTPException( fail(new AriaHTTPException(
@ -218,6 +219,7 @@ final class HttpDThreadTaskAdapter extends BaseHttpThreadTaskAdapter {
progress(len); progress(len);
} }
} }
fos.flush();
handleComplete(); handleComplete();
} catch (IOException e) { } catch (IOException e) {
fail(new AriaHTTPException(String.format("文件下载失败,savePath: %s, url: %s", getEntity().getFilePath(), fail(new AriaHTTPException(String.format("文件下载失败,savePath: %s, url: %s", getEntity().getFilePath(),
@ -257,6 +259,7 @@ final class HttpDThreadTaskAdapter extends BaseHttpThreadTaskAdapter {
file.write(buffer, 0, len); file.write(buffer, 0, len);
progress(len); progress(len);
} }
file.flush();
} }
/** /**

Loading…
Cancel
Save