public static interface FileDownloadHelper.OutputStreamCreator
| Modifier and Type | Method and Description |
|---|---|
FileDownloadOutputStream |
create(java.io.File file)
The output stream creator is used for creating
FileDownloadOutputStream which is
used to write the input stream to the file for downloading. |
boolean |
supportSeek() |
FileDownloadOutputStream create(java.io.File file) throws java.io.IOException
FileDownloadOutputStream which is
used to write the input stream to the file for downloading.
Note: please create a output stream which append the content to the exist file, which means that bytes would be written to the end of the file rather than the beginning.
file - the file will used for storing the downloading content.file.java.io.FileNotFoundException - if the file exists but is a directory
rather than a regular file, does not exist but cannot
be created, or cannot be opened for any other reasonjava.io.IOExceptionboolean supportSeek()
true if the FileDownloadOutputStream is created through
create(File) support FileDownloadOutputStream.seek(long) function.
If the FileDownloadOutputStream is created through create(File) doesn't
support FileDownloadOutputStream.seek(long), please return false, in
order to let the internal mechanism can predict this situation, and handle it smoothly.