当前位置: 首页>>代码示例>>Java>>正文


Java FileDownloadHelper.OutputStreamCreator方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:DownloadMgrInitialParams.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:DownloadMgrInitialParams.java

示例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();
    }
}
 
开发者ID:lingochamp,项目名称:FileDownloader,代码行数:18,代码来源:DownloadMgrInitialParams.java

示例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;
}
 
开发者ID:lingochamp,项目名称:FileDownloader,代码行数:29,代码来源:DownloadMgrInitialParams.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:CustomComponentHolder.java

示例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;
}
 
开发者ID:lingochamp,项目名称:FileDownloader,代码行数:12,代码来源:CustomComponentHolder.java

示例7: createDefaultOutputStreamCreator

import com.liulishuo.filedownloader.util.FileDownloadHelper; //导入方法依赖的package包/类
private FileDownloadHelper.OutputStreamCreator createDefaultOutputStreamCreator() {
    return new FileDownloadRandomAccessFile.Creator();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:DownloadMgrInitialParams.java


注:本文中的com.liulishuo.filedownloader.util.FileDownloadHelper.OutputStreamCreator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。