rn-fetch-blob通过2G下载文件时,无法缓冲整个正文的内容长度

时间:2018-12-18 04:06:52

标签: android

private void done(Response resp) {
  ...
   case FileStorage:
      Log.i("", "FileStorage");
      try {
          // In order to write response data to `destPath` we have to invoke this method.
          // It uses customized response body which is able to report download progress
          // and write response data to destination path.
          resp.body().bytes();
          Log.i("FileStoragell=========  ", String.valueOf(resp.body().bytes()));
      } catch (Exception ignored) {
          Log.i("FileStorage88=========  ", ignored.getMessage());
          //ignored.printStackTrace();
      }
      this.destPath = this.destPath.replace("?append=true", "");
      Log.i("FileStorage======destPath===  ", this.destPath);
      callback.invoke(null, RNFetchBlobConst.RNFB_RESPONSE_PATH, this.destPath);
      break;
  ...
}

日志:

FileStorage88 =========:无法为内容长度缓冲整个主体:2259475963 FileStorage ====== destPath ===:/storage/emulated/0/com.backuper/Download/admin/extdisk/临时文件/临时文件.rar

0 个答案:

没有答案