lingochamp / lingochamp/FileDownloader

自定义FileDownloadOutputStream失败

Open
#1,045 2 comments 0 reactions 1 assignee View on GitHub

@rantianhua is already working on this.

Since Jun 10, 2018.

need-info
Dominant language
Java
Stars
11.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

不知为何自定义FileDownloadOutputStream后

   FileDownloader.setupOnApplicationOnCreate(this)
                .maxNetworkThreadCount(5)
                .connectionCreator(new FileDownloadUrlConnection
                        .Creator(new FileDownloadUrlConnection.Configuration()
                        .connectTimeout(15_000) // set connection timeout.
                        .readTimeout(15_000) // set read timeout.
                        .proxy(Proxy.NO_PROXY) // set proxy
                ))
                .outputStreamCreator(new FileDownloadHelper.OutputStreamCreator() {
                    @Override
                    public FileDownloadOutputStream create(File file) throws IOException {
                        return new CustomFileDownloadRandomAccessFile.Creator().create(file);
                    }

                    @Override
                    public boolean supportSeek() {
                        return true;
                    }
                })
                .commit();

使用时,不会走我自定义的FileDownloadOutputStream,还是会走默认的FileDownloadRandomAccessFile
研读了一下代码无果,希望能帮忙解决,非常感谢

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.