本文整理汇总了Java中com.liulishuo.filedownloader.util.FileDownloadHelper.OutputStreamCreator方法的典型用法代码示例。如果您正苦于以下问题:Java FileDownloadHelper.OutputStreamCreator方法的具体用法?Java FileDownloadHelper.OutputStreamCreator怎么用?Java FileDownloadHelper.OutputStreamCreator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liulishuo.filedownloader.util.FileDownloadHelper
的用法示例。
在下文中一共展示了FileDownloadHelper.OutputStreamCreator方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createOutputStreamCreator
import com.liulishuo.filedownloader.util.FileDownloadHelper; //导入方法依赖的package包/类
public FileDownloadHelper.OutputStreamCreator createOutputStreamCreator() {
if (mMaker == null) {
return createDefaultOutputStreamCreator();
}
final FileDownloadHelper.OutputStreamCreator outputStreamCreator = mMaker.mOutputStreamCreator;
if (outputStreamCreator != null) {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "initial FileDownloader manager with the customize " +
"output stream: %s", outputStreamCreator);
}
return outputStreamCreator;
} else {
return createDefaultOutputStreamCreator();
}
}
示例2: outputStreamCreator
import com.liulishuo.filedownloader.util.FileDownloadHelper; //导入方法依赖的package包/类
/**
* 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().FILE_NON_PRE_ALLOCATION) {
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;
}
示例3: createOutputStreamCreator
import com.liulishuo.filedownloader.util.FileDownloadHelper; //导入方法依赖的package包/类
public FileDownloadHelper.OutputStreamCreator createOutputStreamCreator() {
if (mMaker == null) {
return createDefaultOutputStreamCreator();
}
final FileDownloadHelper.OutputStreamCreator outputStreamCreator =
mMaker.mOutputStreamCreator;
if (outputStreamCreator != null) {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "initial FileDownloader manager with the customize "
+ "output stream: %s", outputStreamCreator);
}
return outputStreamCreator;
} else {
return createDefaultOutputStreamCreator();
}
}
示例4: outputStreamCreator
import com.liulishuo.filedownloader.util.FileDownloadHelper; //导入方法依赖的package包/类
/**
* 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;
}
示例5: getOutputStreamCreator
import com.liulishuo.filedownloader.util.FileDownloadHelper; //导入方法依赖的package包/类
private FileDownloadHelper.OutputStreamCreator getOutputStreamCreator() {
if (outputStreamCreator != null) return outputStreamCreator;
synchronized (this) {
if (outputStreamCreator == null)
outputStreamCreator = getDownloadMgrInitialParams().createOutputStreamCreator();
}
return outputStreamCreator;
}
示例6: getOutputStreamCreator
import com.liulishuo.filedownloader.util.FileDownloadHelper; //导入方法依赖的package包/类
private FileDownloadHelper.OutputStreamCreator getOutputStreamCreator() {
if (outputStreamCreator != null) return outputStreamCreator;
synchronized (this) {
if (outputStreamCreator == null) {
outputStreamCreator = getDownloadMgrInitialParams().createOutputStreamCreator();
}
}
return outputStreamCreator;
}
示例7: createDefaultOutputStreamCreator
import com.liulishuo.filedownloader.util.FileDownloadHelper; //导入方法依赖的package包/类
private FileDownloadHelper.OutputStreamCreator createDefaultOutputStreamCreator() {
return new FileDownloadRandomAccessFile.Creator();
}