public static class FileDownloadRandomAccessFile.Creator extends java.lang.Object implements FileDownloadHelper.OutputStreamCreator
| Constructor and Description |
|---|
Creator() |
| 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() |
public FileDownloadOutputStream create(java.io.File file) throws java.io.IOException
FileDownloadHelper.OutputStreamCreatorFileDownloadOutputStream 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.
create in interface FileDownloadHelper.OutputStreamCreatorfile - 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.IOExceptionFileDownloadRandomAccessFile.Creatorpublic boolean supportSeek()
supportSeek in interface FileDownloadHelper.OutputStreamCreatortrue if the FileDownloadOutputStream is created through
FileDownloadHelper.OutputStreamCreator.create(File) support FileDownloadOutputStream.seek(long) function.
If the FileDownloadOutputStream is created through FileDownloadHelper.OutputStreamCreator.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.