lingochamp/FileDownloader · error · IllegalArgumentException
Since the provided FileDownloadOutputStream does not…
Error message
Since the provided FileDownloadOutputStream does not support the seek function, if FileDownloader pre-allocates file size at the beginning of the download, it will can not be resumed from the breakpoint. If you need to ensure that the resumption is available, please add and set the value of 'file.non-pre-allocation' field to 'true'
What it means
Error "Since the provided FileDownloadOutputStream does not support the seek function, if FileDownloader pre-allocates file size at the beginning of the download, it will can not be resumed from the breakpoint. If you need to ensure that the resumption is available, please add and set the value of 'file.non-pre-allocation' field to 'true'" thrown in lingochamp/FileDownloader.
Solutions
- Set 'file.non-pre-allocation=true' in filedownloader.properties (or via InitCustomMaker) to skip pre-allocation so downloads can resume from breakpoints with non-seekable streams
- Provide a FileDownloadOutputStream implementation that supports seek() and set it through outputStreamCreator(...) so pre-allocation remains safe
- Use the default FileDownloadOutputStream (based on RandomAccessFile) which supports seeking
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at library/src/main/java/com/liulishuo/filedownloader/services/DownloadMgrInitialParams.java:290 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of lingochamp/FileDownloader@6237a8cac1 (2026-09-08).
Data as JSON: /api/errors/52a2d7903bcb1f0b.
Report an issue: GitHub.
Appendix: source
Thrown at library/src/main/java/com/liulishuo/filedownloader/services/DownloadMgrInitialParams.java:290
}
return this;
}
/**
* Customize the output stream component.
* <p>
* If you don't customize the output stream component, we use the result of
* {@link #createDefaultOutputStreamCreator()} as the default one.
*
* @param creator The output stream creator is used for creating
* {@link FileDownloadOutputStream} which is used to write the input stream
* to the file for downloading.
*/
public InitCustomMaker outputStreamCreator(FileDownloadHelper.OutputStreamCreator creator) {
this.mOutputStreamCreator = creator;
if (mOutputStreamCreator != null && !mOutputStreamCreator.supportSeek()) {
if (!FileDownloadProperties.getImpl().fileNonPreAllocation) {
throw new IllegalArgumentException(
"Since the provided FileDownloadOutputStream "
+ "does not support the seek function, if FileDownloader"
+ " pre-allocates file size at the beginning of the download,"
+ " it will can not be resumed from the breakpoint. If you need"
+ " to ensure that the resumption is available, please add and"
+ " set the value of 'file.non-pre-allocation' field to 'true'"
+ " in the 'filedownloader.properties' file which is in your"
+ " application assets folder manually for resolving this "
+ "problem.");
}
}
return this;
}
/**
* Customize the connection component.
* <p>
* If you don't customize the connection component, we use the result ofView on GitHub (pinned to 6237a8cac1)